robert-hh / SH1106

MicroPython driver for the SH1106 OLED controller
Other
157 stars 38 forks source link

OLED does not display when writing firmware for the first time #37

Open zou-hong-run opened 1 year ago

zou-hong-run commented 1 year ago

This code was invalid the first time it was run

from machine import Pin, SPI import sh1106

spi = SPI(1, baudrate=1000000,sck=Pin(14),mosi=Pin(13)) display = sh1106.SH1106_SPI(128, 64, spi, Pin(5), Pin(2), Pin(4),rotate= 0, delay=0) display.reset() display.flip(True) display.sleep(False) display.fill(0) display.text('hello world', 0,0, 1) display.rect(0, 0, 50, 50, 1) display.show()

print("testing")

This code is effective when OLED suddenly lights up, It's very strange that I suddenly get better and can use it, but it won't show up when I write the program