{"id":18098413,"url":"https://github.com/kevincastejon/js-raspberrypi-liquid-crystal-simple","last_synced_at":"2026-04-30T06:39:02.768Z","repository":{"id":42817411,"uuid":"250372544","full_name":"kevincastejon/js-raspberrypi-liquid-crystal-simple","owner":"kevincastejon","description":"Simple control of i2c lcd on Raspberry Pi","archived":false,"fork":false,"pushed_at":"2023-08-08T01:42:52.000Z","size":471,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T04:17:34.103Z","etag":null,"topics":["i2c-lcd","raspberry","raspberry-pi","raspberrypi-liquid-crystal"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kevincastejon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-03-26T21:10:39.000Z","updated_at":"2022-02-22T15:34:22.000Z","dependencies_parsed_at":"2024-10-31T20:10:52.830Z","dependency_job_id":"4134df20-fd21-4d2c-b4cc-8ae8a01a881a","html_url":"https://github.com/kevincastejon/js-raspberrypi-liquid-crystal-simple","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevincastejon%2Fjs-raspberrypi-liquid-crystal-simple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevincastejon%2Fjs-raspberrypi-liquid-crystal-simple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevincastejon%2Fjs-raspberrypi-liquid-crystal-simple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevincastejon%2Fjs-raspberrypi-liquid-crystal-simple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevincastejon","download_url":"https://codeload.github.com/kevincastejon/js-raspberrypi-liquid-crystal-simple/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevincastejon%2Fjs-raspberrypi-liquid-crystal-simple/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259262608,"owners_count":22830560,"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":["i2c-lcd","raspberry","raspberry-pi","raspberrypi-liquid-crystal"],"created_at":"2024-10-31T20:10:50.565Z","updated_at":"2026-04-30T06:38:57.735Z","avatar_url":"https://github.com/kevincastejon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# raspberrypi-liquid-crystal-simple\n Simple control of i2c lcd on Raspberry Pi\n\n## Overview\nThis module encapsulates the raspberrypi-liquid-crystal module to make its use easier.\nYour screen content is represented by an array of string corresponding to each line, and settings such as cursor, blink, etc... are boolean properties.\nYou can change them at any moment and the screen will display the changes as soon as possible without overlapping the commands.\n\n## Install\nBe sure to have enabled I2C on your raspberry, if not use ```sudo raspi-config``` interface to do it\n```\nnpm i raspberrypi-liquid-crystal-simple\n```\n\n## Usage\nBe sure to use the right address depending on your i2c lcd device, here is an example with 0x3F address\n```\nconst LCD = require('raspberrypi-liquid-crystal-simple');\n\n// Init a 1602 lcd on 0x3f i2c address on i2c bus 1 with 16 characters width and 2 lines\nconst lcd = new LCD(1, 0x3f, 16, 2);\n\n// then change all the lines at once\n\nlcd.lines = ['Hello', 'World'];\n\n// or separately\n\nlcd.setLine(0, 'Hello');\nlcd.setLine(1, 'World');\n\n// Change the different LCD settings\nlcd.blink = true;\nlcd.cursor = true;\nlcd.display = true;\n```\n\n## Text alignment\nYou can specify an alignment for each LCD line. LEFT is default.\n```\nlcd.setAlignment(0, LCD.CENTER);    // Will center the first line\nlcd.setAlignment(1, LCD.RIGHT);     // Will align right the second line\n```\n\n## Custom characters\nYou can create up to 8 custom characters by providing a list of array of number representing your characters dots into the constructor last optional argument. Then use them by inserting LCD.getChar(charId) into any string.\n```\nconst LCD = require('raspberrypi-liquid-crystal-simple');\nconst customChars = [\n  [0x0,0xa,0x1f,0x1f,0xe,0x4,0x0],  // Heart character\n  [0x0,0x0,0xa,0x0,0x11,0xe,0x0],  // Smiley character\n];\nconst lcd = new LCD(1, 0x3f, 16, 2, customChars);\nlcd.init();\nlcd.setLine(0, 'Hello' + LCD.getChar(0) + 'World' + LCD.getChar(1))\n```\nYou can use this online tool to easily generate chars (copy and paste the hexadecimals value)\nhttp://www.quinapalus.com/hd44780udg.html\n\n## API\n- **constructor ( bus : int, address : int, cols : int, rows : int [, customChars : [][]int] )**\n### Constants\n- **LEFT** static [read-only] : string - Shortcut for \"left\" value, use it along with setAlignement() method.\n- **RIGHT** static [read-only] : string - Shortcut for \"right\" value, use it along with setAlignement() method.\n- **CENTER** static [read-only] : string - Shortcut for \"center\" value, use it along with setAlignement() method.\n### Properties\n- **address** [read-only] : int - The i2c address declared when instantiating the LCD object.\n- **busNumber** [read-only] : int - The bus number declared when instantiating the LCD object.\n- **blink** : boolean - If true it will display a white blinking block at the cursor position.\n- **cols** [read-only] : int - The number of characters width declared when instantiating the LCD object.\n- **cursor** : boolean - If true it will display a underscore line at the cursor position.\n- **display** : boolean - If false it will turn off the lcd (backlight). Turns on if true.\n- **lines** : []string - The lcd lines text content. Don't modify directly the array content\n- **rows** [read-only] : int - The number of lines declared when instantiating the LCD object.\n- **ready** [read-only] : boolean - True if the LCD has been initialized, false if not.\n### Methods\n- **clear ()** : void - Removes any content on the screen.\n- **getAlignment ( lineIndex : int )** : string - Returns the text alignment on the specified line.\n- **getLine ( lineIndex : int )** : string - Returns the text content of the specified line.\n- **init ()** : void - Initializes the lcd so it starts displaying (asynchronous, listen on the \"ready\" event on the lcd).\n- **initSync ()** : void - Synchronous version of init() method.\n- **setAlignement ( lineIndex : int, alignment : string )** : void - Sets the text alignment on the specified line. Use the static constants LCD.LEFT, LCD.RIGHT and LCD.CENTER or directly the strings \"left\", \"right\" and \"center\"\n- **setLine ( lineIndex : int, text : string )** : void - Sets the text content of the specified line.\n- **getChar ( id : int )** static - Returns a custom character given on the constructor at specified id (0 to 7).\n### Events\n- **ready** () - Fires when the lcd is initialized and ready to display.\n- **error** (error) - Fires when an error is encountered.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevincastejon%2Fjs-raspberrypi-liquid-crystal-simple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevincastejon%2Fjs-raspberrypi-liquid-crystal-simple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevincastejon%2Fjs-raspberrypi-liquid-crystal-simple/lists"}