SSD1306 I2C
- philwilkinson40
- Posts: 63
- Joined: Tue Nov 14, 2017 3:11 am
- Location: Perth, Australia
Re: SSD1306 I2C
sorry @pythoncoder, I forgot I wrote some notes at the top of the SSD1306.py module to remind me why I used an older version! So that is what threw the line numbering (poor coding mistake!)
I really don't know how you put up with such poor mistakes! Thanks.
Now with the OLED object correctly instantiated the OLED runs perfectly!
I really don't know how you put up with such poor mistakes! Thanks.
Now with the OLED object correctly instantiated the OLED runs perfectly!
- Attachments
-
- IMG_20171230_20246.jpg (49.31 KiB) Viewed 7432 times
Re: SSD1306 I2C
Using ssd1306.py (2017.12.13) I get the error
"AttributeError: type object 'super' has no attribute '__init__'
MicroPython v1.9.3-238-g42c4dd09 on 2017-12-31; ESP32 module with ESP32"
Using ssd1306.py (2017.10.06) works fine.
It's the same using SPI.
"AttributeError: type object 'super' has no attribute '__init__'
MicroPython v1.9.3-238-g42c4dd09 on 2017-12-31; ESP32 module with ESP32"
Using ssd1306.py (2017.10.06) works fine.
It's the same using SPI.
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: SSD1306 I2C
Yes, the current version of the SSD1306 driver in the micropython repo is broken.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: SSD1306 I2C
If you read my earlier messages in this thread you will find the reason and the workround.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: SSD1306 I2C
Sorry for my late reply, there was no time for the last couple of days.pythoncoder wrote: ↑Sun Dec 24, 2017 8:09 amIf that fails I'd suspect the hardware - you should have better luck with Adafruit's excellent products.
It seems that my I2C display is damaged. A check using an Arduino Leonardo shows no reaction.
Using an adafruit 128x32 SPI display works fine:
Code: Select all
>>> from machine import Pin, SPI
>>> import ssd1306
>>> res =Pin(2)
>>> dc = pin(4)
>>> dc = Pin(4)
>>> ss =Pin(15)
>>> spi = SPI(2, baudrate=14500000, sck=Pin(18), mosi=Pin(23))
>>> oled = ssd1306.SSD1306_SPI(128,32,spi,dc,res,ss)
>>> oled.text("Hello",0,0)
>>> oled.text("You",48,10)
>>> oled.text("Guys!",72,20)
>>> oled.show()
Thanks again for your help!
Best regards,
Stefan
- Attachments
-
- 20180102_203208[2].jpg (66.78 KiB) Viewed 7402 times
Re: SSD1306 I2C
I think you forgot to connect the pullup resistors.
Re: SSD1306 I2C
That's correct. For the SPI display it works without them. I know that isn't correct.
Regarding to the I2C - display: as stated in my posts before, with or without pullups, no difference in the behaviour.
Best regards,
Stefan
Re: SSD1306 I2C
SPI doesn't require pullups.
-
- Posts: 1
- Joined: Tue Jun 04, 2019 2:12 am
Re: SSD1306 I2C
@pythoncoder Hello Peter, sorry to re-open this old thread...
I tried to download your modified version of the SSD1306 but the page doesn't exist in your repo.
Have you moved it somewhere else?
Could you please share it?
Thank you so much!
-Paolo
I tried to download your modified version of the SSD1306 but the page doesn't exist in your repo.
Have you moved it somewhere else?
Could you please share it?
Thank you so much!
-Paolo
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: SSD1306 I2C
If you're aiming to use the Writer module it now works with the official driver. See the Writer docs.
The MicroPython firmware was updated to allow the subclassing of the FrameBuffer class. This prompted a substantial revision of the Writer and CWriter classes to be compatible with any display driver which subclasses FrameBuffer. These also now support multiple displays, colour rendering, upside-down rendering, tab expansion etc.
The MicroPython firmware was updated to allow the subclassing of the FrameBuffer class. This prompted a substantial revision of the Writer and CWriter classes to be compatible with any display driver which subclasses FrameBuffer. These also now support multiple displays, colour rendering, upside-down rendering, tab expansion etc.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.