{"id":20796402,"url":"https://github.com/jazz-soft/char-lcd","last_synced_at":"2025-05-06T07:48:09.696Z","repository":{"id":57197010,"uuid":"154783631","full_name":"jazz-soft/char-lcd","owner":"jazz-soft","description":"Character LCD display emulator","archived":false,"fork":false,"pushed_at":"2025-01-05T04:19:14.000Z","size":50,"stargazers_count":32,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-01T00:46:32.399Z","etag":null,"topics":["character-lcd","hd44780","lcd"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jazz-soft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-26T05:49:15.000Z","updated_at":"2025-03-19T04:59:25.000Z","dependencies_parsed_at":"2024-05-10T03:23:43.024Z","dependency_job_id":"b5c5acd6-a9f9-49f0-aa3b-bdf3e66abe63","html_url":"https://github.com/jazz-soft/char-lcd","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazz-soft%2Fchar-lcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazz-soft%2Fchar-lcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazz-soft%2Fchar-lcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazz-soft%2Fchar-lcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jazz-soft","download_url":"https://codeload.github.com/jazz-soft/char-lcd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252642361,"owners_count":21781306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["character-lcd","hd44780","lcd"],"created_at":"2024-11-17T16:27:05.404Z","updated_at":"2025-05-06T07:48:09.690Z","avatar_url":"https://github.com/jazz-soft.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# char-lcd\n\n[![npm](https://img.shields.io/npm/v/char-lcd.svg)](https://www.npmjs.com/package/char-lcd)\n\n## Character LCD display emulator\nEmulate **Hitachi HD44780** and compatible devices in HTML\n\n##### HD44780-A00 (Japanese standard font)  \n![polymer-char-lcd](https://jazz-soft.github.io/img/char-lcd-jp.png)\n\n##### HD44780-A02 (European standard font)  \n![polymer-char-lcd](https://jazz-soft.github.io/img/char-lcd-eu.png)\n\n## Install\n\n`npm install char-lcd --save`  \nor `yarn add char-lcd`  \nor clone the whole project from [**GitHub**](https://github.com/jazz-soft/char-lcd)\n\n## Usage\n\n##### Web Component (Polymer)\n\nhttps://github.com/jazz-soft/polymer-char-lcd\n\n##### Plain HTML\n\n```html\n\u003cscript src=\"char-lcd.js\"\u003e\u003c/script\u003e\n//...\n```\n\n##### CDN (jsdelivr)\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/char-lcd\"\u003e\u003c/script\u003e\n//...\n```\n\n##### CDN (unpkg)\n\n```html\n\u003cscript src=\"https://unpkg.com/char-lcd\"\u003e\u003c/script\u003e\n//...\n```\n\n##### CommonJS\n\n```js\nvar CharLCD = require('char-lcd');\n//...\n```\n\n##### TypeScript / ES6\n\n```js\nimport { CharLCD } from 'char-lcd';\n//...\n```\n\n##### AMD\n\n```js\nrequire(['char-lcd'], function(CharLCD) {\n  // ...\n});\n```\n\n## Example\n```html\n\u003cdiv id=\"lcd\"\u003e\u003c/div\u003e\n\n\u003cscript\u003e\n  var lcd = new CharLCD({ at: 'lcd', rows: 4, cols: 16, rom: 'eu' });\n\n  // Example 1: Display a single custom character at row 0, column 0\n  // To set a custom character, use String.fromCharCode to map a character byte (16-255).\n  // In this case, use character code 16, which is the first non-blank character in the set.\n  lcd.char(0, 0, String.fromCharCode(16));  // Set the custom character at row 0, column 0\n\n  // Example 2: Display another custom character at row 1, column 0\n  lcd.char(1, 0, String.fromCharCode(17));  // Set another custom character at row 1, column 0\n\n  // Example 3: Display a string with mapped Unicode characters\n  // The lcd.text() function will automatically map Unicode characters to the internal character set.\n  lcd.text(2, 1, \"Hello LCD!\");\n  lcd.text(3, 0, \"ЁЛКИ-ПАЛКИ!\");\n\u003c/script\u003e\n```\n\n## API\n##### constructor\n`var lcd = new CharLCD(params);`  \n`params` is an object with the following keys:  \n- `at`: a DOM element in which to place the object, or its `id`;\ndefault: at the bottom of the page;  \n- `rom`: `jp` (default) for Japanese standard font, or `eu` for European standard font.  \n- `rows`: number of rows;\ndefault: 2;  \n- `cols`: number of columns;\ndefault: 16;\n- `pix`: pixel size; default: 3;\n- `brk`: space between pixel; default: 1;\n- `off`: character pixel off color (background); default: #cd2;\n- `on`: character pixel on color; default: #143;\n- `transitionDuration`: character pixel transition duration; default: 100ms;\n\nUnlike the real hardware where only certain combinations of `rows`/`cols` exist, there are no restrictions in the simulator;\n\n\n##### char(r, c, h)\n`lcd.char(r, c, h);` - set the character at row `r`, column `c` to byte `h`.\n\n##### text(r, c, s)\n`lcd.text(r, c, s);` - print string `s` at row `r`, column `c`.  \nThis function treats `\\n` as new line and maps UNICODE characters to the internal character set.\n\n##### font(n, data)\n`lcd.font(n, data);` - define the pixels for the `n`-th character; `data` is an array of up to 10 bytes.  \nIn real hardware, only first 8 characters can be changed, but there is no such limitation in the simulator.\n\n##### clear()\n`lcd.clear();` - clear all characters in LCD.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjazz-soft%2Fchar-lcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjazz-soft%2Fchar-lcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjazz-soft%2Fchar-lcd/lists"}