{"id":20563406,"url":"https://github.com/pilotak/mbed-text-display","last_synced_at":"2025-10-28T23:18:20.248Z","repository":{"id":91903395,"uuid":"358983632","full_name":"pilotak/mbed-text-display","owner":"pilotak","description":"LCD \u0026 OLED text display library for mbed OS 6","archived":false,"fork":false,"pushed_at":"2021-04-27T20:55:05.000Z","size":63,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T08:20:45.872Z","etag":null,"topics":["hd44780","lcd","lcd16x2","lcd20x4","mbed","mbed-os","oled","oled-display","rs0010","ws0010"],"latest_commit_sha":null,"homepage":"","language":"C++","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/pilotak.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-04-17T21:14:05.000Z","updated_at":"2024-11-14T09:40:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"5decbeeb-f904-434f-91de-2bb38f621ab6","html_url":"https://github.com/pilotak/mbed-text-display","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pilotak/mbed-text-display","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fmbed-text-display","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fmbed-text-display/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fmbed-text-display/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fmbed-text-display/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pilotak","download_url":"https://codeload.github.com/pilotak/mbed-text-display/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fmbed-text-display/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279015931,"owners_count":26085777,"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-10-13T02:00:06.723Z","response_time":61,"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":["hd44780","lcd","lcd16x2","lcd20x4","mbed","mbed-os","oled","oled-display","rs0010","ws0010"],"created_at":"2024-11-16T04:18:32.369Z","updated_at":"2025-10-13T15:37:48.813Z","avatar_url":"https://github.com/pilotak.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mbed LCD \u0026 OLED text display library\n\n[![Framework Badge mbed](https://img.shields.io/badge/framework-mbed-008fbe.svg)](https://os.mbed.com/)\n\nBased on work by [sstaub](https://github.com/sstaub/mbedLCD) which is based on [Simon's work](https://os.mbed.com/users/simon/code/TextLCD/).\nSo what is the difference, why another fork?\n\n- optional R/W pin which enables reading busy flag to avoid fixed waiting time (once the display finishes the task it will let you know)\n- rewritten initialization - not done in constructor in case you are using voltage level translator with OE pin \u0026 avoids delays\n- enums are within class context - in case you have a same variable defined elsewhere in the code, it will not collide\n- all display types share the same codebase, they only rewrite pin handling \u0026 initialization\n- you can specify char size 5x8 or 5x10 pixels\n- I2C packpack (PCF8574) supported, there are two pinouts on the market - both are supported\n\nSupports HD44780 _(tested)_, RS0010 _(tested)_ and WS0010 _(untested)_ interfaces commonly found in text LCD/OLED displays.\n\n## Example\n\n### LCD\n\n```cpp\n#include \"TextLCD.h\"\n\n#define DISPLAY_RS_pin PB_1\n#define DISPLAY_E_pin  PB_2\n#define DISPLAY_D4_pin PB_3\n#define DISPLAY_D5_pin PB_4\n#define DISPLAY_D6_pin PB_5\n#define DISPLAY_D7_pin PB_6\n\nconst uint8_t upArrow[8] = {\n    0b00100,\n    0b01010,\n    0b10001,\n    0b00100,\n    0b00100,\n    0b00100,\n    0b00000,\n};\n\nconst uint8_t downArrow[8] = {\n    0b00000,\n    0b00100,\n    0b00100,\n    0b00100,\n    0b10001,\n    0b01010,\n    0b00100,\n};\n\nconst uint8_t rightArrow[8] = {\n    0b00000,\n    0b00100,\n    0b00010,\n    0b11001,\n    0b00010,\n    0b00100,\n    0b00000,\n};\n\nconst uint8_t leftArrow[8] = {\n    0b00000,\n    0b00100,\n    0b01000,\n    0b10011,\n    0b01000,\n    0b00100,\n    0b00000,\n};\n\nTextLCD lcd(DISPLAY_RS_pin, DISPLAY_E_pin, DISPLAY_D4_pin, DISPLAY_D5_pin,\n             DISPLAY_D6_pin, DISPLAY_D7_pin);\n\nint main() {\n    ThisThread::sleep_for(50ms); // give a time to wakeup the controller\n\n    lcd.init();\n    lcd.display(TextLCD::DISPLAY_ON);\n\n    lcd.printf(\"Hello world\\n\");\n\n    // try display functions\n    ThisThread::sleep_for(2s);\n    lcd.display(TextLCD::CURSOR_ON);\n    lcd.display(TextLCD::BLINK_ON);\n    ThisThread::sleep_for(4s);\n    lcd.display(TextLCD::BLINK_OFF);\n    ThisThread::sleep_for(2s);\n    lcd.display(TextLCD::CURSOR_OFF);\n    ThisThread::sleep_for(2s);\n\n    // clear\n    lcd.cls();\n\n    // create custom characters\n    lcd.create(0, downArrow);\n    lcd.create(1, upArrow);\n    lcd.create(2, rightArrow);\n    lcd.create(3, leftArrow);\n\n    // show custom characters\n    lcd.locate(0, 0);\n    lcd.character(0, 0, 0);\n    lcd.character(2, 0, 1);\n    lcd.character(4, 0, 2);\n    lcd.character(6, 0, 3);\n\n    // try long text\n    lcd.locate(0, 0);\n    lcd.printf(\"Really long hello world\\nwith scrolling\");\n    ThisThread::sleep_for(2s);\n\n    // scroll\n    while (1) {\n        for (auto pos = 0; pos \u003c (23 - lcd.columns()); pos++) {\n            lcd.display(TextLCD::SCROLL_LEFT);\n            ThisThread::sleep_for(150ms);\n        }\n\n        ThisThread::sleep_for(1s);\n\n        for (auto pos = 0; pos \u003c (23 - lcd.columns()); pos++) {\n            lcd.display(TextLCD::SCROLL_RIGHT);\n            ThisThread::sleep_for(150ms);\n        }\n\n        ThisThread::sleep_for(2s);\n    }\n}\n```\n\n### OLED\n\n```cpp\n#include \"TextOLED.h\"\n\n#define DISPLAY_RS_pin PB_1\n#define DISPLAY_E_pin  PB_2\n#define DISPLAY_D4_pin PB_3\n#define DISPLAY_D5_pin PB_4\n#define DISPLAY_D6_pin PB_5\n#define DISPLAY_D7_pin PB_6\n#define DISPLAY_RW_pin PB_7\n\nTextOLED oled(DISPLAY_RS_pin, DISPLAY_E_pin, DISPLAY_D4_pin, DISPLAY_D5_pin,\n             DISPLAY_D6_pin, DISPLAY_D7_pin, DISPLAY_RW_pin);\n\nconst char spinner[] = {0x7C, 0x2F, 0x2D, 0xDA};\n\nint main() {\n    ThisThread::sleep_for(500ms); // give a time to wakeup the controller\n\n    oled.init(TextOLED::FONT_EUROPEAN_I);\n    oled.display(TextOLED::DISPLAY_ON);\n\n    // animate spinner\n    while(1){\n        for (size_t i = 0; i \u003c sizeof(spinner); i++) {\n            oled.character(0, 0, spinner[i]);\n            ThisThread::sleep_for(150ms);\n        }\n    }\n}\n```\n\n### LCD I2C\n```cpp\n#include \"TextLCD_I2C.h\"\n\n#define SDA PB_9\n#define SCL PB_8\n\nTextLCD_I2C lcd(SDA, SCL, false); // set to true if LCD backpack has different pinout\n\nint main() {\n    ThisThread::sleep_for(50ms); // give a time to wakeup the controller\n\n    if (lcd.init()) {\n        printf(\"init OK\\n\");\n        lcd.display(TextLCD_I2C::DISPLAY_ON);\n        lcd.setBacklight(true);\n        lcd.printf(\"Hello world\\n\");\n\n    } else {\n        printf(\"error\\n\");\n    }\n}\n```\n\n### OLED I2C\nYou can use the constructor same as above or you can pass existing I2C object\n\n```cpp\n#include \"TextOLED_I2C.h\"\n\n#define SDA PB_9\n#define SCL PB_8\n\nI2C i2c(SDA, SCL)\nTextOLED_I2C oled;\n\nint main() {\n    ThisThread::sleep_for(500ms); // give a time to wakeup the controller\n\n    if (oled.init(\u0026i2c)) {\n        printf(\"init OK\\n\");\n        oled.display(TextOLED_I2C::DISPLAY_ON);\n        oled.printf(\"Hello world\\n\");\n\n    } else {\n        printf(\"error\\n\");\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilotak%2Fmbed-text-display","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpilotak%2Fmbed-text-display","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilotak%2Fmbed-text-display/lists"}