JonHylands / ssd1106

A minor modification of https://github.com/khenderick/micropython-drivers/blob/master/ssd1306/ssd1306.py for the ssd1106
2 stars 1 forks source link

ESP support #1

Open mkarliner opened 7 years ago

mkarliner commented 7 years ago

Hi Jon, thanks for this module. Could you give me any pointers for modifying it to use with the ESP? I assume the pyb references are all exclusive to the pyboard.

cheers Mike

JonHylands commented 7 years ago

Hi Mike, Yes, pyb is for the pyboard. machine is the corresponding thing for the esp. You will need to find the corresponding objects for the ESP module, and make sure you're sending arguments in the right order. For example: pyb.Pin(pinout['dc'], pyb.Pin.OUT_PP, pyb.Pin.PULL_DOWN) becomes: machine.Pin(pinout['dc'], machine.Pin.OUT, None) and you'll need an external pull-down on that pin, since the ESP doesn't have internal pulldowns like the pyboard. Note that I haven't tested the SPI version of this code - I don't have an SPI ssd1106 module, only an I2C one.