{"id":16965311,"url":"https://github.com/magicmonkey/pico-ssd1306","last_synced_at":"2025-03-21T17:28:23.822Z","repository":{"id":136993820,"uuid":"483385336","full_name":"magicmonkey/pico-ssd1306","owner":"magicmonkey","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-19T19:40:16.000Z","size":11269,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T12:27:56.249Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magicmonkey.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":"2022-04-19T19:38:58.000Z","updated_at":"2022-04-19T19:40:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"a504face-79cd-4065-a2dd-b89402ad58f9","html_url":"https://github.com/magicmonkey/pico-ssd1306","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/magicmonkey%2Fpico-ssd1306","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicmonkey%2Fpico-ssd1306/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicmonkey%2Fpico-ssd1306/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicmonkey%2Fpico-ssd1306/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magicmonkey","download_url":"https://codeload.github.com/magicmonkey/pico-ssd1306/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244837327,"owners_count":20518612,"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":[],"created_at":"2024-10-13T23:45:39.181Z","updated_at":"2025-03-21T17:28:23.789Z","avatar_url":"https://github.com/magicmonkey.png","language":"C","readme":"# SSD1306 OLED Library for RP2040\n\n## 1. Importing the library\n* Clone this project into your pico project\n* Add this to your CMakeLists.txt\n  ```cmake\n    add_subdirectory(pico-ssd1306)\n    target_link_libraries(your_project_name\n    pico_ssd1306\n    # you will also need hardware i2c library for communication with the display\n    hardware_i2c)\n  ```\n* Import library in your code\n  ```c++\n  #include \"pico-ssd1306/ssd1306.h\"\n  // You also need i2c library to communicate with the display\n  #include \"hardware/i2c.h\"\n  ```\n## 2. Basic usage\n```c++\ni2c_init(I2C_PORT, 1000000); //Use i2c port with baud rate of 1Mhz\n//Set pins for I2C operation\ngpio_set_function(I2C_PIN_SDA, GPIO_FUNC_I2C);\ngpio_set_function(I2C_PIN_SCL, GPIO_FUNC_I2C);\ngpio_pull_up(I2C_PIN_SDA);\ngpio_pull_up(I2C_PIN_SCL);\n\n//Create a new display object\npico_ssd1306::SSD1306 display = pico_ssd1306::SSD1306(I2C_PORT, 0x3D, pico_ssd1306::Size::W128xH64);\n\n//create a vertical line on x: 64 y:0-63\nfor (int y = 0; y \u003c 64; y++){\n    display.setPixel(64, y);\n}\ndisplay.sendBuffer(); //Send buffer to device and show on screen\n```\n### Expected output:\n![example1](images/ex1.png) \n\nYou may have noticed that this entire library is under pico_ssd1306 namespace to avoid conflicts, but if you don't have any\nconflicts and don't want to write ```pico_ssd1306::``` all the time just add \n```c++\nusing namespace pico_ssd1306;\n```\nto your file\n\n## 3. Principles of operation\nSee [usage explanation](usage.md) for detailed information on how to use core of the lib, but in short:\n* First Initialize i2c and pins for i2c communication\n* Create a display object. This automatically send setup commands to the device and prepares it for operation\n* Modify the buffer containing pixel data\n* Send buffer to display\n* Clear the buffer and repeat\n\n## 4. Pixel Addressing\n![pixel_addressing](images/ex5.png)\n\nsame is true for 128x32 displays, then y range is 0-31\n\n## 5. Additional Modules\nThis library comes with additional modules for shape rendering and text rendering to make your life easier\n### Importing Shape Renderer\n```c++\n#include \"pico-ssd1306/shapeRenderer/ShapeRenderer.h\"\n```\nSee: [Shape Renderer readme](shapeRenderer/readme.md) for usage and details\n### Importing Text Renderer\n```c++\n#include \"pico-ssd1306/textRenderer/TextRenderer.h\"\n```\nSee: [Text Renderer readme](textRenderer/readme.md) for usage and details\n\n## 6. Examples\nSee [examples](examples). Many of them have their own readmes. Many things are also explained in code comments.\n\n## 7. Documentation\nDocumentation of all functions is [here](https://ssd1306.harbys.me)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicmonkey%2Fpico-ssd1306","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagicmonkey%2Fpico-ssd1306","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicmonkey%2Fpico-ssd1306/lists"}