{"id":22199945,"url":"https://github.com/durydevelop/arduino-lib-oled","last_synced_at":"2025-08-06T16:33:23.528Z","repository":{"id":32636281,"uuid":"132886310","full_name":"durydevelop/arduino-lib-oled","owner":"durydevelop","description":"Driver for OLED displays with SSD1306 or SH1106","archived":false,"fork":false,"pushed_at":"2022-12-23T10:29:55.000Z","size":54,"stargazers_count":52,"open_issues_count":8,"forks_count":15,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-27T03:51:59.899Z","etag":null,"topics":["arduino","oled","sh1106","ssd1306"],"latest_commit_sha":null,"homepage":"","language":"C++","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/durydevelop.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}},"created_at":"2018-05-10T10:38:36.000Z","updated_at":"2025-07-12T18:48:57.000Z","dependencies_parsed_at":"2023-01-14T21:47:30.107Z","dependency_job_id":null,"html_url":"https://github.com/durydevelop/arduino-lib-oled","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/durydevelop/arduino-lib-oled","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durydevelop%2Farduino-lib-oled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durydevelop%2Farduino-lib-oled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durydevelop%2Farduino-lib-oled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durydevelop%2Farduino-lib-oled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/durydevelop","download_url":"https://codeload.github.com/durydevelop/arduino-lib-oled/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durydevelop%2Farduino-lib-oled/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269112394,"owners_count":24361960,"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-08-06T02:00:09.910Z","response_time":99,"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","oled","sh1106","ssd1306"],"created_at":"2024-12-02T15:19:16.614Z","updated_at":"2025-08-06T16:33:23.303Z","avatar_url":"https://github.com/durydevelop.png","language":"C++","readme":"# Driver for OLED displays with SSD1306 or SH1106\n\n\n***\n### This driver is distributed without license. You may use it for free.\nAuthor: Stefan Frings, 2017\n\n### Update by:\nAuthor: Fabio Durigon, 2018, 2022\\\nemail: develop@dury.it\n***\n\n## Features:\n * Supported display sizes: 196x16, 28x32 and 128x64 pixels.\n * The I2C communication is done by software bit-banging the configurable I/O pins.\n * Supports all print() and write() calls as the internal Serial lib of Arduino core.\n * Supports also standard C/C++ printf() function.\n * Added printf(x,y,...) to print directly at x,y coordinate with one call.\n * Some special characters are handled like in unix mode:\n \t'\\n' or '\\r' -\u003e The cursor is moved to the begin of next line.\n \t'\\r' and '\\n' consecutive (also inverted) acts as a single one so -\u003e The cursor is moved to the begin of next line.\n \t'\\f' like line-feed scroll up entire page.\n * TTY mode:\n \t* Display can be used like a terminal window (without positioning the cursor before print).\n \t* Any call to setCursor() has no effect.\n \t* When the cursor position reach the bottom of the screen, the page is scrolled up by one line.\n * Added some wrappers for U8g2 library API compatibily. Now, for writing strings, You can use same U8g2 APIs (see [How to use](#how-to-use)):\n    * drawString(Column,Row,String) -\u003e  draw string at specific ROW and COLUMN.\n    * inverse()                     -\u003e  enable inverted font print.\n    * noInverse()                   -\u003e  disable inverted font print.\n \n## Limitations:\n * This driver supports only displays with internal charge pump and I2C interface.\n * Communication errors are not handled.\n * Only one 6x8 font is supported.\n \n## How to use:\n\n### 1) Declaration\nThis constructor is DEPRECATED:\n\n```C++\nOLED(uint8_t sda_pin,\t\t\t     // sda pin for I2C comunication\n     uint8_t scl_pin,\t\t\t     // scl pin for I2C comunication\n\t uint8_t reset_pin=NO_RESET_PIN, // Reset pin (default: none)\n\t uint8_t i2c_address=0x3C,\t\t // I2C address (default: 0x3C)\n\t uint_fast8_t width=128,\t\t // Pixel width\n\t uint_fast8_t height=32,\t\t // Pixel Height\n\t bool isSH1106=false\t\t\t // Display type: true for SSD1306, false for SH1106 (default: false)  \n);\n```\nPlease Use this one:\n```C++\n    OLED(uint8_t sda_pin,                       // sda pin for I2C comunication\n         uint8_t scl_pin,                       // scl pin for I2C comunication\n\t     uint8_t reset_pin=NO_RESET_PIN,        // Reset pin (default: none)\n         tWidth width=W_128,                    // Display width, must be one of enum: W_96 or W_128 (default: W_128).\n         tHeight height=H_32,                   // Display height, must be one of enum: H_16, H_32 or OLED::H_64 (default: H_32).\n         tDisplayCtrl displayCtrl=CTRL_SSD1306, //Display controller chip, must be one of enum: CTRL_SH1106 or CTRL_SSD1306 (default: CTRL_SSD1306).\n         uint8_t i2c_address=0x3C               // I2C address (default: 0x3C)\n    );\n```\nNow, minimal instance can be:\n\n```C++\nOLED Display(4,5,16);\n```\n\t\nthat means:\n\n```C++\n// Contructor used for OLED display directly mounted on NodeMCU WiFi_KIT_8 model from Heltec (http://www.heltec.cn/project/wifi-kit-8/?lang=en).\nOLED Display(4,5,16,OLED::W_128,OLED::H_32,OLED::CTRL_SSD1306,0x3C);\n```\n\u0026nbsp;\n### 2) Initialize display lib like Serial artuino lib:\n\n```C++\ndisplay.begin();\n```\n\u0026nbsp;\n### 3) Write a string in 5 different ways. All these methods will produce the same output:\n\n```C++\n// Method 1: pixel position\ndisplay.draw_string(6,8,\"Hello World\");\n\n// Method 2: pixel position\ndisplay.setCursor(6,8);\ndisplay.print(\"Hello World\");\n\n// Method 3: pixel position\ndisplay.printf(6,8,\"Hello World\");\n\n// Method 4: pixel position\ndisplay.setCursor(6,8);\ndisplay.printf(\"Hello World\");\n\n// Method 5: ROW and COLUMN position (U8g2 library API wrapper)\ndisplay.drawString(1,1,\"Hello World\");\n```\n\u0026nbsp;\n### 4) Show on display\nPrevious function calls only put data in display memory. When You want di show it up, You need to call:\n```C++\ndisplay.display();\n```\nThis call tell to display driver to refresh the view with memory content.\n\u0026nbsp;\n### U8g2 wrappers:\nSetup U8g2:\n```C++\n#include \u003cU8x8lib.h\u003e\nU8X8_SSD1306_128X64_NONAME_HW_I2C display(U8X8_PIN_NONE,19,18);\ndisplay.begin();\ndisplay.setFont(u8x8_font_chroma48medium8_r);\n```\nSetup this lib (no need to set font):\n\n```C++\n#include \u003coled.h\u003e\nOLED display(18,19,NO_RESET_PIN,OLED::W_128,OLED::H_64);\ndisplay.begin();\n```\nCommon usage:\n```C++\ndisplay.inverse();\ndisplay.drawString(0,0,\"Inverted Hello World\"); // first line\ndisplay.noInverse();\ndisplay.drawString(0,1,\"Normal Hello World\"); // second line\n```\nThe only difference is that this lib use only one 6x8 font, so, total columns are 21 insead of 16 of U8g2 8x8 font.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurydevelop%2Farduino-lib-oled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdurydevelop%2Farduino-lib-oled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurydevelop%2Farduino-lib-oled/lists"}