Hi, I need your help because, as an old(74) newbie as I am, I was not abe to use the SH1107 library (sh1107.py) for the Waveshare Pico-OLED-1.3" 128x64 display that is designed to work as a shield on Pico and uses SPI.
The poroblem is - I think - with SPI that I'm not able to use properly ( even if I've used it both for SD card and TFT LCD).
With another "standard" I2C SH1107 display connected to my Pico I'm able to display data from a BME280 and time from RTC DS3231.
On the contrary, with this SPI display I am not even able to display "Hello World" and after several unsuccesful attempts, - also connecting the display not directly to the Pico but with jumpers connected according to Waveshare datasheet (https://www.waveshare.com/wiki/Pico-OLED-1.3) - I'm asking for help.
I know that I could desolder the 0 Ohm resistors on the back of display that is set for SPI and put a little blob of solder between the I2C connections so that it becomes a I2C but I'd prefer to solve this obstacle by using the correct software. Here is the code that doen't show anything on the display
The poroblem is - I think - with SPI that I'm not able to use properly ( even if I've used it both for SD card and TFT LCD).
With another "standard" I2C SH1107 display connected to my Pico I'm able to display data from a BME280 and time from RTC DS3231.
On the contrary, with this SPI display I am not even able to display "Hello World" and after several unsuccesful attempts, - also connecting the display not directly to the Pico but with jumpers connected according to Waveshare datasheet (https://www.waveshare.com/wiki/Pico-OLED-1.3) - I'm asking for help.
I know that I could desolder the 0 Ohm resistors on the back of display that is set for SPI and put a little blob of solder between the I2C connections so that it becomes a I2C but I'd prefer to solve this obstacle by using the correct software. Here is the code that doen't show anything on the display
Code:
[/from machine import Pin, SPIimport sh1107import timefrom time import sleep# - 3v3 - xxxxxx - Vcc# - G - xxxxxx - Gnd# - D7 - GPIO 15 - TX / MOSI fixed# - D5 - GPIO 14 - SCK / Sck fixed# - D8 - GPIO 13 - CS (optional, if the only connected device)# - D2 - GPIO 21 - DC [Data/Command]# - D1 - GPIO 20 - Res [reset]#spi1 = SPI(1, baudrate=10_000_000, sck=Pin(14), mosi=Pin(15), miso=Pin(12))display = sh1107.SH1107_SPI(128, 64, spi1, Pin(21), Pin(20), Pin(13))display.sleep(False)display.fill(0) display.text('Hello', 0, 0, 1)display.text('World', 0, 8, 1)display.show()print("Hello world") #This is correctly printed on the shell code]Thanks in advance for your suggestions
Statistics: Posted by bruno1950 — Mon Jul 01, 2024 10:42 am