{"id":23752483,"url":"https://github.com/rwbl/lcd-custom-char-maker","last_synced_at":"2026-05-16T11:34:40.190Z","repository":{"id":156024001,"uuid":"180736994","full_name":"rwbl/lcd-custom-char-maker","owner":"rwbl","description":"Application to create custom characters for LCD displays.","archived":false,"fork":false,"pushed_at":"2021-02-15T13:10:57.000Z","size":1483,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-25T00:21:57.883Z","etag":null,"topics":["arduino","b4j","b4x","custom-lcd-character","lcd","raspberry-pi","tinkerforge"],"latest_commit_sha":null,"homepage":"","language":"Batchfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rwbl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-04-11T07:20:14.000Z","updated_at":"2023-05-09T04:45:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"615f0c7e-bb83-4843-a5e9-fde0cc9fdc58","html_url":"https://github.com/rwbl/lcd-custom-char-maker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rwbl/lcd-custom-char-maker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwbl%2Flcd-custom-char-maker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwbl%2Flcd-custom-char-maker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwbl%2Flcd-custom-char-maker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwbl%2Flcd-custom-char-maker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rwbl","download_url":"https://codeload.github.com/rwbl/lcd-custom-char-maker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwbl%2Flcd-custom-char-maker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274407330,"owners_count":25279267,"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","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["arduino","b4j","b4x","custom-lcd-character","lcd","raspberry-pi","tinkerforge"],"created_at":"2024-12-31T17:53:04.279Z","updated_at":"2026-05-16T11:34:35.162Z","avatar_url":"https://github.com/rwbl.png","language":"Batchfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LCD-Custom-Char-Maker\r\nCreate Custom Characters for LCD displays connected to Arduino, Raspberry Pi, Tinkerforge or other\r\n\r\n* Created with [B4J v8.00](https://www.b4x.com/b4j.html) - development tool for cross platform desktop, server and IoT solutions.\r\n* Requires Java JDK 8 to run. Ensure to comply to the [Oracle JDK Licence agreement](https://www.oracle.com/downloads/licenses/oracle-javase-license.html).\r\n* Developed for personal \u0026 development use only.\r\n\r\n![lcdcustomcharmaker](https://user-images.githubusercontent.com/47274144/72811224-7de5e700-3c5f-11ea-81ab-df8d4fbfeb9f.png)\r\n\r\n## Functionality\r\n* Create custom LCD character with 5 pixel horizontal (cols), 8 pixel vertical (rows).\r\n* Each row is represented by a byte with 5 bits.\r\n* Create DEC, HEX and BIN arrays.\r\n* Save / open the character to / from a textfile located in the application folder.\r\n* Import 8 bytes array string in format 0xNN,0xNN... where NN is HEX value.\r\n* Convert LCD character table high \u0026 low bits to DEC \u0026 HEX values.\r\n* Various language specific examples\r\n* Some example chars in the project source/objects folder.\r\n\r\n## Files\r\n* lcdcustomcharmaker.zip contains the application, sample characters and examples.\r\n\r\n## Install\r\nFrom the source/Objects folder, run the Java jar **lcdcustomcharmaker.jar**\r\n```\r\njava -jar lcdcustomcharmaker.jar\r\n```\r\n\r\n**Notes:**\r\n* The full B4J source code is included (folder source).\r\n* An example batch file \"run8.bat\" to run under Windows is included. Ensure to set the path to the JDK8 folder.\r\n* There is also a \"run11.bat\" for running with openJDK11 - might require to recompile first with B4J using openJDK11.\r\n\r\n## Example Coding Custom Character Battery\r\n\r\nThis example covers various development tools B4R, B4J and dedicated Tinkerforge 20x4 bricklet with C, Java, JavaScript, MQTT \u0026 Python.\r\n\r\nExample output for the custom character Battery (empty):\r\n\r\n```\r\n' B4X HEX array\r\nDim battery(8) As Byte\r\nbattery = Array As Byte (0x0E, 0x1B, 0x11, 0x11, 0x11, 0x11, 0x11, 0x1F)\r\n\r\n// C byte array\r\nByte battery[8] = {B01110, B11011, B10001, B10001, B10001, B10001, B10001, B11111};\r\n// C int8_t array\r\nint8_t battery[8] = {14, 27, 17, 17, 17, 17, 17, 31};\r\n\r\n# Python int array\r\nbattery = [14, 27, 17, 17, 17, 17, 17, 31]\r\n\r\n// Java short array\r\nshort[] battery = new short[]{14, 27, 17, 17, 17, 17, 17, 31}\r\n\r\n// JavaScript int array\r\nbattery = [14, 27, 17, 17, 17, 17, 17, 31]\r\n\r\n# JSON Tinkerforge MQTT2 index 0 and int array\r\n{\"index\":0, \"character\":[14, 27, 17, 17, 17, 17, 17, 31]}\r\n```\r\n\r\n### Tinkerforge\r\nThe LCD 20x4 Bricklet supports up to 8 custom characters 0-7 which are mapped to \\u0008-\\u000F (\\u takes hex numbers).\r\nTested defining and writing custom characters with an LCD 20x4 v1.2 Bricklet having UID=BHN.\r\nSome API snippet exmples.\r\n\r\n#### C\r\n```\r\n// Create device object\r\nLCD20x4 lcd;\r\n\r\n// Clear display \u0026 turn backlight on\r\nlcd_20x4_clear_display(\u0026lcd);\r\nlcd_20x4_backlight_on(\u0026lcd);\r\n\r\n// Custom Char battery assigned to index 0 (from max 7)\r\nint8_t battery[8] = {14,27,17,17,17,17,17,31};\r\nlcd_20x4_set_custom_character(\u0026lcd,0, battery);\r\n// Write text and the custom character\r\nlcd_20x4_write_line(\u0026lcd, 0, 0, \"Battery: \\x08\"); \r\n```\r\n\r\n#### Java\r\n```\r\nBrickletLCD20x4 lcd = new BrickletLCD20x4(UID, ipcon); // Create device object\r\n\r\n// Clear \u0026 turn backlight on\r\nlcd.clearDisplay();\r\nlcd.backlightOn();\r\n\r\n// Custom Char battery assigned to index 0 (from max 7)\r\nshort[] battery = new short[]{14,27,17,17,17,17,17,31};\r\nlcd.setCustomCharacter((short)0, battery);\r\n// Display the custom char with some text\r\nlcd.writeLine((short)0, (short)0, \"Battery: \" + \"\\u0008\");\r\n//lcd.writeLine((short)0, (short)0, \"Battery: \" + (char)0x08); \r\n```\r\n\r\n#### JavaScript\r\n```\r\nvar lcd = new Tinkerforge.BrickletLCD20x4(UID, ipcon); // Create device object\r\n\r\n// Clear \u0026 turn backlight on\r\nlcd.clearDisplay();\r\nlcd.backlightOn();\r\n\r\n// Custom Char battery assigned to index 0 (from max 7)\r\nbattery = [14,27,17,17,17,17,17,31]\r\nlcd.setCustomCharacter(0, battery)\r\n// Display the custom char with some text\r\nlcd.writeLine(0, 0, \"Battery: \" + \"\\x08\")        \r\n```\r\n\r\n#### MQTT V2\r\n*Test 1:* Turn the display backlight on, clear the display and display text string \"Hello World\".\r\n```\r\nmosquitto_pub -t tinkerforge/request/lcd_20x4_bricklet/BHN/backlight_on -m ''\r\nmosquitto_pub -t tinkerforge/request/lcd_20x4_bricklet/BHN/clear_display -m ''\r\nmosquitto_pub -t tinkerforge/request/lcd_20x4_bricklet/BHN/write_line -m '{\"line\": 0, \"position\": 0, \"text\": \"Hello World\"}'\r\n```\r\n\r\n*Test 2:* Define \u0026 custom character Battery.\r\n\r\nThe JSON definition for the custom character battery set to index 0 (the first custom character at position 0x08 = \\u0008):\r\n```\r\n{\"index\":0, \"character\":[14, 27, 17, 17, 17, 17, 17, 31]}\r\n```\r\nSet custom character 0:\r\n```\r\nmosquitto_pub -t tinkerforge/request/lcd_20x4_bricklet/BHN/set_custom_character -m '{\"index\":0, \"character\":[14, 27, 17, 17, 17, 17, 17, 31]}'\r\n```\r\n\r\nWrite it to the display with some text: \r\n```\r\nmosquitto_pub -t tinkerforge/request/lcd_20x4_bricklet/BHN/write_line -m '{\"line\": 0, \"position\": 0, \"text\": \"Battery: \\u0008\"}'\r\n```\r\n\r\n#### Python\r\n```\r\nlcd = BrickletLCD20x4(UID, ipcon) # Create device object\r\n\r\n# Clear \u0026 Turn backlight on\r\nlcd.clear_display()\r\nlcd.backlight_on()\r\n\r\n# Custom Char battery assigned to index 0 (from max 7)\r\nbattery = [14,27,17,17,17,17,17,31]\r\nlcd.set_custom_character(0, battery)\r\n# Display the custom char with some text\r\nlcd.write_line(0, 0, \"Battery: \" + \"\\x08\")\r\n```\r\n\r\n### B4R \r\n\r\n#### B4R Binary Definition\r\n```\r\nByte battery[8] = {B01110,B11011,B10001,B10001,B10001,B10001,B10001,B11111};                            \r\n```\r\n#### B4R Example\r\nInlineC Code is required to display the special characters.\r\nThis example can be used by copy and paste in projects.\r\n```\r\n'Inline C to define the special characters\r\n'Usage:\r\n'  Private CharArrowUp As Byte = 0\r\n'  Private CharArrowDown As Byte = 1\r\n'  Private CharArrowEq As Byte = 2\r\n'  RunNative(\"createChar\", Null)\r\n'  lcd.SetCursor(0,0)\r\n'  RunNative(\"writeChar\", CharArrowUp)                \r\n'  lcd.SetCursor(5,0)\r\n'  RunNative(\"writeChar\", CharArrowDown)\r\n'  lcd.SetCursor(10,0)\r\n'  RunNative(\"writeChar\", CharArrowEq)\r\n#if C                                                               \r\nByte arrowup[8] = {B00000,B00100,B01110,B11111,B00100,B00100,B00100,B00000};\r\nByte arrowdown[8] = {B00000,B00100,B00100,B00100,B11111,B01110,B00100,B00000};\r\nByte arroweq[8] = {B00000,B00000,B11111,B00000,B11111,B00000,B00000,B00000};\r\n```\r\n\r\n```\r\n//Create the special chars:0=arrow up, 1=arrow down, 2=arrow equal\r\n//RunNative(\"createChar\", Null)\r\nvoid createChar(B4R::Object* o) {\r\n   b4r_main::_lcd-\u003elc-\u003ecreateChar(0, arrowup);\r\n   b4r_main::_lcd-\u003elc-\u003ecreateChar(1, arrowdown);\r\n   b4r_main::_lcd-\u003elc-\u003ecreateChar(2, arroweq);\r\n}\r\n\r\n//Write a special character to the display: 0=arrow up, 1=arrow down, 2=arrow equal\r\n//lcd.SetCursor(0,1)\r\n//RunNative(\"writeChar\", 0)\r\nvoid writeChar(B4R::Object* o) {\r\n   b4r_main::_lcd-\u003elc-\u003ewrite((Byte)o-\u003etoULong());\r\n}\r\n#end if                                                          \r\n```\r\n\r\n#### Hint\r\nTo write a character from the character table of the LCD Display driver.\r\nThe Degree Character ° is located at position upper 4 bits 1101 and lower 4 bits 1111.\r\nThe 8 bits 1101 1111 are HEX DF and DEC 223.\r\nTo write the character to the LCD use lcd.Write(Array As Byte(223)).\r\n\r\n### LCD Character Table\r\nConvert Upper 4 \u0026 Lower 4 bits to HEX and Unicode\r\nExample Cent Character: Upper 4 bits = 1110, Lower 4 bits = 1111\r\nConverted:\r\n11101111 = EF , 0xEF , \\u00EF, 239\r\n\r\nUse the LCD display datasheet accordingly.\r\n\r\n## Licence\r\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS for A PARTICULAR PURPOSE.  See the GNU General Public License for more details.\r\nYou should have received a copy of the GNU General Public License along with the samples.  If not, see [GNU Licenses](http://www.gnu.org/licenses/).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwbl%2Flcd-custom-char-maker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frwbl%2Flcd-custom-char-maker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwbl%2Flcd-custom-char-maker/lists"}