mcauser / micropython-ssd1327

MicroPython driver for SSD1327 128x128 4-bit greyscale OLED displays
MIT License
25 stars 10 forks source link

Suppport for Raspberry Pi Pico #2

Closed rodrigocmn closed 3 years ago

rodrigocmn commented 3 years ago

The new Raspberry Pi Pico's MicroPython does not support start, write and stop operations for IC2. These operations are used in the write_data function.

The solution I've found was to identify the board via uos.uname() and use IC2.writeto() operation. This solution is included in my forked version, so I will create a pull request in case you want to merge the code.

BTW, I've also included a fix for chinese OLEDs offset problem in this pull request.

mcauser commented 3 years ago

I upgraded the driver from MicroPython 1.9 to 1.14, and replaced the i2c.start() i2c.write() i2c.stop() with i2c.writevto() which works on the ESP32 and RPI Pico.

Similar ssd1306 upgrade: https://github.com/micropython/micropython/commit/02afc0d241dbd0efb985ba5a7ded9cea616ffcd7

Issue that gave us i2c.writevto: https://github.com/micropython/micropython/issues/3482