Go Down

Topic: Heltec WiFi Kit OLED -- strange behavior (Read 197 times) previous topic - next topic

jrdoner

I have a program on the Heltec ESP32 WiFi kit which measures some data, and under some circumstances, goes into timer-controlled sleep.  I noticed that when it wakes up, the last data displayed on the OLED is still there, even if I used display.clearDisplay() (Adafruit library) rignt before going to sleep.  After looking at the library for the display, it was obvious that the clearDisplay() function writes all zeros to the buffer for the display, so I concluded that clearDisplay() doesn't actually clear the display.  I had to follow that command with display.display() to get the all-zero buffer into the display.

This is the first time I have used one of these displays, in conjunction with any chip.  Is the situation the same for all SSD1306 displays, or is this just an oversight in the Adafruit library?

Thanks in advance for any information on this.

jrdoner

MAS3

#1
May 14, 2020, 08:30 am Last Edit: May 14, 2020, 08:31 am by MAS3
You're right, the buffer will be filled.
But the buffer isn't the same as the display itself.

So now you need to transfer the contents of the buffer to the display, and you'll do that by the display.display() command.

This way you can build a picture by filling the buffer at some lower speed, and once you're done the contents of the buffer can be transferred / shown instantly (well, as fast as possible), instead of you seeing the contents of the display being built.

I'm not sure if you can set another method which doesn't use the buffer in this way.
It's been 7 years since i read the SSD1306 datasheet, that's too long ago to remember such details.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Go Up