It took me a while to figure out things, so here are a few lessons learned. May serve to get you started.
- to build and deploy, run
Code: Select all
- a correct powerup sequence is necessary to enable the regulators on the board, see https://github.com/hoihu/projects/blob/ ... mi/limi.py
- to access the OLED use the driver of @tobbard https://github.com/tobbad/micropython_l ... seps525.py (you'll need to spezify XSIZE, YSIZE in pixel)
The driver above is not compliant with the framebuffer module, so I changed it a bit. Since the framebuffer logic is now part of the master branch I was able to shorten the code (at the expense of some helper utilites like circle). This can be found here: https://github.com/hoihu/projects/blob/ ... seps525.py
And good news: the frambuffer support has just recently been enabled to support RGB565 support (thanks @deshipu) and further optimized to fast-fill regions (that's from damien). So you'll get a nice speed increase.
If you are at that point, checkout peter hinch's font creator utility (https://github.com/peterhinch/micropython-font-to-py). I used that to create a reasonable large font (23px) - the font provided by the micropython repo is way too small for a 160x128pixel display.
At the moment Peters Writer class implementation uses the 1bit framebuffer mapping hard-coded to speedup things. It will not work with the 16bit framebuffer. I issued this here https://github.com/peterhinch/micropyth ... y/issues/1 . He provided me with sample code to use the framebuffer's pixel method. With this modifications it is then possible to show some nice, large texts
Note that I also had to change some small things of the writer's implementation. This definetly needs cleanup and may serve just as example.
Some test code to see how everything fits can be found here:
https://github.com/hoihu/projects/blob/ ... mi/test.py