0

PiOLED 128x32 displays dots, no text
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: PiOLED 128x32 displays dots, no text

by slclarktx on Wed Aug 07, 2019 9:56 am

I have tried some different tactics and found that the module is not resetting when it starts up. When running a program the display gives garbage. Then I can touch the the reset wire to ground, the display goes blank. When I rerun the same program the display works as it should. A manual reset as you noted above.

The ssd1306 program references self reset, is that an internal reset that does not require a wire from the reset pin? If so it may not be working correctly with my set up.

Thanks again for your guidance.

slclarktx
 
Posts: 14
Joined: Thu Jul 04, 2013 11:44 am

Re: PiOLED 128x32 displays dots, no text

by adafruit_support_carter on Wed Aug 07, 2019 3:31 pm

The ssd1306 program references self reset, is that an internal reset that does not require a wire from the reset pin?

Where are you seeing this?

adafruit_support_carter
 
Posts: 12675
Joined: Tue Nov 29, 2016 2:45 pm

Re: PiOLED 128x32 displays dots, no text

by slclarktx on Wed Aug 07, 2019 4:08 pm

You sent a link to adafruit_ssd1306.py and I found references to self reset on lines 74-76, 135, 136, 138, and 140.

slclarktx
 
Posts: 14
Joined: Thu Jul 04, 2013 11:44 am

Re: PiOLED 128x32 displays dots, no text

by adafruit_support_carter on Wed Aug 07, 2019 4:15 pm

Ah, OK. The driver code. That requires a wire. You pass the pin that the wire is connected to in when you create the SSD1306 object:
Code: Select all | TOGGLE FULL SIZE
disp = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c, reset=board.D23)

But since that is an optional parameter, there is code to check for it. That's what you are looking at. Basically it's saying "if you gave me a reset pin, I will toggle it low for 0.010 seconds"
Code: Select all | TOGGLE FULL SIZE
        if self.reset_pin:
            self.reset_pin.value = 1
            time.sleep(0.001)
            self.reset_pin.value = 0
            time.sleep(0.010)
            self.reset_pin.value = 1
            time.sleep(0.010)

For the display to actually see that reset, you need a wire between that pin and the RST pin on the display.

adafruit_support_carter
 
Posts: 12675
Joined: Tue Nov 29, 2016 2:45 pm

Re: PiOLED 128x32 displays dots, no text

by slclarktx on Wed Aug 07, 2019 6:06 pm

I connected the wire from module RST to gpio 23 and modified the stats.py program as shown.

disp = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c, reset=board.D23)

I get the following error message

Traceback (most recent call last):
File "stats_01.py", line 43, in <module> disp = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c, reset=board.D23)
File "/usr/local/lib/python3.7/dist-packages/adafruit_ssd1306.py", line 184, in __init__external_vcc=external_vcc, reset=reset)
File "/usr/local/lib/python3.7/dist-packages/adafruit_ssd1306.py", line 76, in __init__self.reset_pin.switch_to_output(value=0)
AttributeError: 'Pin' object has no attribute 'switch_to_output'

Please advise how to proceed.

slclarktx
 
Posts: 14
Joined: Thu Jul 04, 2013 11:44 am

Re: PiOLED 128x32 displays dots, no text

by adafruit_support_carter on Wed Aug 07, 2019 6:14 pm

Sorry. My bad. It doesn't want the actual pin object, but a digitalio object made with the pin. Fairly easy to fix. Add an import of digitalio up near the top with the other imports:
Code: Select all | TOGGLE FULL SIZE
import digitalio

and then change that line to:
Code: Select all | TOGGLE FULL SIZE
disp = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c, reset=digitalio.DigitalInOut(board.D23))

adafruit_support_carter
 
Posts: 12675
Joined: Tue Nov 29, 2016 2:45 pm

Re: PiOLED 128x32 displays dots, no text

by slclarktx on Wed Aug 07, 2019 8:41 pm

Thanks very much, that seems to have fixed the display so that it works. I'm curious why my unit needs the reset wire while the PiOLED plug in unit just has 4 connections. That will keep for another effort. My system is working and that's good.

Thanks for your patience and expertise.

slclarktx
 
Posts: 14
Joined: Thu Jul 04, 2013 11:44 am

Please be positive and constructive with your questions and comments.