Mercurial > micropython-oled
changeset 1:3d7d948fc7e9 draft
Add more docs
| author | Radomir Dopieralski <sheep-devel@sheep.art.pl> |
|---|---|
| date | Tue, 17 Oct 2017 01:54:44 +0200 |
| parents | a28b87ff3a97 |
| children | 3caad24615e1 |
| files | README.md |
| diffstat | 1 files changed, 29 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/README.md Tue Oct 17 01:24:38 2017 +0200 +++ b/README.md Tue Oct 17 01:54:44 2017 +0200 @@ -1,8 +1,34 @@ +MicroPython OLED +================ + +This is a collection of drivers for handling monochrome OLED displays. There +are many versions of such drivers, and there is even a driver for the SSD1306 +included in MicroPython's repository, but I decided to make my own, because I +needed something a little bit more optimized. + +To conserve memory, each version of each driver is in a separate self-contained +file that you need to copy to your board. There is no inheritance and no +multiple imports -- I'm only using the build-in `framebuf` module. Of course +that means there is some repetition between the different drivers, but that's a +price I'm willing to pay. There are also no constants that would need to be +converted to bytes before sending -- I'm using raw byte strings everywhere. + +To make it fast, I'm calling MicroPython's built-in functions directly, without +wrapping them into convenience functions. I'm also only allocating any memory +once, at the beginning, and then re-using those buffers for everything. + +Finally, I have added some convenience functions for flipping and mirroring the +display, reversing its colors, hardware scrolling, setting contrast and +switching it off and on. + +There are no drawing functions on the display object itself, they are available +on the frame buffer object, available as the `fb` attribute. + Examples -******** +======== SH1106 I2C Example -================== +------------------ ```python import sh1106_i2c @@ -16,7 +42,7 @@ ``` SH1106 SPI Example -================== +------------------ ```python import sh1106_spi
