Hi,
First, as I already said, kudos for all your thorough work.
Now:
While trying your ssd1306 & RTC file I get:
File “<stdin>”, line 19, in <module>
File “ssd1306.py”, line 110, in __init__
File “ssd1306.py”, line 36, in __init__
File “ssd1306.py”, line 71, in init_display
File “ssd1306.py”, line 115, in write_cmd
I thought I correctly loaded ssd1306.py on the Pico.
I tried again by downloading a fresh ssd1306.py from another web source to no avail.
I’m sure the error is on my side. Any help will be appreciated.
Renaud
Hi.
Can you tell me exactly what’s the project you’re following?
How are you uploading the files to the Pico?
Regards,
Sara
Hi Sara,
Yes, of course, thanks.
I need RTC for a project so I tried this I get from your book I bought (which btw is excellent!) on a Pico2W with Thonny :
import time
import urtc
from machine import SoftI2C, Pin
import ssd1306
days_of_week = [‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’, ‘Saturday’, ‘Sunday’]
#Initialize RTC Module
i2c_rtc = SoftI2C(scl=Pin(5), sda=Pin(4))
rtc = urtc.DS1307(i2c_rtc)
# Initialize OLED
oled_width = 128
oled_height = 64
i2c_oled = SoftI2C(scl=Pin(7), sda=Pin(6))
oled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2c_oled, addr=0x3c)
This gets:
Traceback (most recent call last):
File “<stdin>”, line 19, in <module>
File “ssd1306.py”, line 110, in __init__
File “ssd1306.py”, line 36, in __init__
File “ssd1306.py”, line 71, in init_display
File “ssd1306.py”, line 115, in write_cmd
OSError: [Errno 19] ENODEV
So, I tried to load another ssd1306 from another site but got the same.
Also I tried scanning I2C bus:
on SDA=GP4, SCL=GP5… I2C devices found on 0x50 and 0x68
so the cabling is correct and anyway this error is certainly independent of the hardware as I tried it on another Pico without RTC or Oled and got the same errors.
To load the library I load the ssd1306.py file on Thonny and save it on the Pico. As I said it is indeed there at 4585 octets.
Best,
Renaud