[Risolto] Troubleshooting the OLED Screen
I am not sure if this is the right place but in case its not feel free to move the topic :) . Long story short - there is an OLED screen in the emote pack and in fact it has been working for me on several occasions. However - right now i am trying to execute a simple OLED Screen routine (see attached screenshot):
- The OLED is connected to Port 3 (my information is that it currently only works on Port 3) so in the code I select the port (3)
- I also selected the "Show" block because i don't know what it means xD and it looks like it could mean the screen needs to be ON
- Then I picked the eyes...
- and the mouth and then I wait for 2 seconds
Now In the Monitor I get the following output:
Warning: I2C(-1, ...) is deprecated, use SoftI2C(...) instead                                                                                                                                          ÂTraceback (most recent call last):                                                                                                                                                                     Â  File "<stdin", line 7, in <module                                                                                                                                                                    Â  File "ottooled.py", line 10, in __init__                                                                                                                                                             Â  File "ssd1306.py", line 112, in __init__                                                                                                                                                             Â  File "ssd1306.py", line 38, in __init__                                                                                                                                                              Â  File "ssd1306.py", line 73, in init_display                                                                                                                                                          Â  File "ssd1306.py", line 117, in write_cmd                                                                                                                                                            ÂOSError: [Errno 116] ETIMEDOUT      Â
Hi @agentknopf you found a bug in the recent update we moved the "default" OLED connection to #1 as default according to the manual, the "setup block" you are using there is to change the connector number in case you want to have it in different to # accommodate other components.
the generator is not deleting the original GPIO declaration:
@cparrapa I confirm this as fixed - works in port 1 no issues :) thank you !
Hi there i wanted to follow-up on the OLED issue (see image attached with code and error message). I wanted to ask if the fix has been published so i can chose the port myself now for the oled screen using the setup block? I am asking because i wanted to do the following:
- OLED in port 3
- Proximity sensor in port 1 (Because i dont think i can set the port for it manually? And it does not work in Port 3)
- MP3 Player in Port 2
Thank you :)Â
Hi @@agentknopf
We had put the setup block at the end of all display blocks because of the I2C settings it must be put at the end of the block code in order to delete the default connection (for now is the best solution for changing the placement of the oled with blocks).
Your code can work if is done as the attachment, sorry for the late response we have been busy with the Advent calendar and promos. :D
@cparrapa thank you for getting back to me - I tried out your suggestion (see attachment) but I am getting an error and I noticed that the widget suddenly has two ports instead of one like in your screenshot - is it a bug? I mean the settings block for OLED: In your screenshot it has one option to select a port, which makes sense. But in my version of the wordblock editor (web) it has 2 for some reason which seems odd :)Â
Also - dont be confused by my code, i defined functions but i am not calling them anywhere yet - which should not be a problem i guess - the issue is already simply with defining the i2c
I tried port 3, error message:
import array # Needed for polygons from ssd1306 import SSD1306_I2C i2c = SoftI2C(sda=Pin(21), scl=Pin(22)) oled = SSD1306_I2C(128, 64, i2c) import machine, time #importing machine and time libraries from time import sleep #importing sleep class from machine import Pin, ADC, PWM, SoftI2C #importing classes
Two ports showing fixed, We have a current silly bug that when function brackets are above the start block it puts all definitions up in the code, that is why the error shows 'SoftI2C'Â becase it is defined after the gipio declaration of the oled. For now you can just move the function at a level below the start block. We will check how to avoid that.
- 16 Forum
- 60 Discussioni
- 295 Post
- 0 In linea
- 3,234 Membri
