Hi I'm new on micropython, I come from arduino, and I know a little bit python.
Sorry for my bad english
I try to use on OLED SSD1306 128x64 SPI on micro python.
I 've use this oled on arduino and it work, but i cant use it on micropython
I use lib SSD1306
Here is my code:
#################
import machine
import ssd1306
spi = machine.SPI(1, baudrate=8000000, polarity=0, phase=0)
oled = ssd1306.SSD1306_SPI(128, 64, spi, machine.Pin('Y3'), machine.Pin('Y4'), machine.Pin('Y5'))
oled.pixel(0,0,1)
oled.show()
#################
And these are my connections : oled > board
GND > GND
VCC > 3V3
D0 > Y6
D1 > Y8 (and i've try Y7)
RES > Y4
DC > Y3
CS > Y5
(I would like to use SPI 2)
Nothing appear on the oled screen
What's wrong ?
Thx a lot
OLED 128x64 SPI mode Can't display simple pixel ?
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: OLED 128x64 SPI mode Can't display simple pixel ?
Your connections are for SPI(2) but your code specifies SPI(1). You need to connect MOSI (Y8) and SCK (Y6) and ignore MISO (Y7).
To get started I would run without optional SPI arguments:
In my usage this worked correctly.
To get started I would run without optional SPI arguments:
Code: Select all
spi = machine.SPI(2)
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.