{"id":13802261,"url":"https://github.com/mcauser/deshipu-micropython-oled","last_synced_at":"2025-05-13T13:30:25.759Z","repository":{"id":150620477,"uuid":"371570277","full_name":"mcauser/deshipu-micropython-oled","owner":"mcauser","description":null,"archived":true,"fork":false,"pushed_at":"2021-05-28T03:35:58.000Z","size":6,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-22T12:34:30.896Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"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/mcauser.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}},"created_at":"2021-05-28T03:35:43.000Z","updated_at":"2023-12-07T10:37:11.000Z","dependencies_parsed_at":"2023-05-26T13:45:59.660Z","dependency_job_id":null,"html_url":"https://github.com/mcauser/deshipu-micropython-oled","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/mcauser%2Fdeshipu-micropython-oled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fdeshipu-micropython-oled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fdeshipu-micropython-oled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fdeshipu-micropython-oled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcauser","download_url":"https://codeload.github.com/mcauser/deshipu-micropython-oled/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253949899,"owners_count":21989268,"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-08-04T00:01:40.497Z","updated_at":"2025-05-13T13:30:25.507Z","avatar_url":"https://github.com/mcauser.png","language":"Python","readme":"Fork of the now archived https://bitbucket.org/thesheep/micropython-oled\n\nMicroPython OLED\n================\n\nThis is a collection of drivers for handling monochrome OLED displays. There\nare many versions of such drivers, and there is even a driver for the SSD1306\nincluded in MicroPython's repository, but I decided to make my own, because I\nneeded something a little bit more optimized.\n\nTo conserve memory, each version of each driver is in a separate self-contained\nfile that you need to copy to your board. There is no inheritance and no\nmultiple imports -- I'm only using the build-in `framebuf` module. Of course\nthat means there is some repetition between the different drivers, but that's a\nprice I'm willing to pay. There are also no constants that would need to be\nconverted to bytes before sending -- I'm using raw byte strings everywhere.\n\nTo make it fast, I'm calling MicroPython's built-in functions directly, without\nwrapping them into convenience functions. I'm also only allocating any memory\nonce, at the beginning, and then re-using those buffers for everything.\n\nFinally, I have added some convenience functions for flipping and mirroring the\ndisplay, reversing its colors, hardware scrolling, setting contrast and\nswitching it off and on.\n\nThere are no drawing functions on the display object itself, they are available\non the frame buffer object, available as the `fb` attribute.\n\nExamples\n========\n\nSH1106 I2C Example\n------------------\n\n```python\nimport sh1106_i2c\nfrom machine import I2C, Pin\n\ni2c = I2C(-1, sda=Pin(4), scl=Pin(5), freq=400000)\nd = sh1106_i2c.Display(i2c)\nd.fb.fill(1)\nd.fb.pixel(64, 32, 0)\nd.update()\n```\n\nSH1106 SPI Example\n------------------\n\n```python\nimport sh1106_spi\nfrom machine import SPI, Pin\n\nspi = SPI(1, baudrate=20000000)\ndc = Pin(12, Pin.OUT)\ncs = Pin(15, Pin.OUT)\nd = sh1106_spi.Display(spi, dc, cs)\nd.fb.fill(1)\nd.fb.pixel(64, 32, 0)\nd.update()\n```\n","funding_links":[],"categories":["Libraries"],"sub_categories":["Display"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcauser%2Fdeshipu-micropython-oled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcauser%2Fdeshipu-micropython-oled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcauser%2Fdeshipu-micropython-oled/lists"}