SSD1306.p module poweron() method #19277
-
|
I am working on a battery powered Pico project where I want to minimise power use when the pico is in lightsleep(). The project has an OLED display attached for which I also want to minimise power draw during lightsleep(). The SSD1306.py library includes poweron() and poweroff() methods. The poweroff() method works as expected and the OLED power consumption drops to a around 15 microamps. However, the poweron() method does nothing. Looking at the source this is because the method consists of a single pass statement. I found an article about the SSD1306 which listed the poweroff() command as 0xAE and the corresponding poweron() command as 0xAF. Looking again at the source of SSD1306.py I see that poweroff() calls self.write_cmd) passing it 0xAE. So, I tried modifying the poweron() method to call self.write_cmd() passing it 0xAF and I am very pleased to say it works exactly as expected. The data is retained in the display when poweroff() is called and restored when poweron() is called. So, I have two questions.
Cheers Ian |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
|
I am not clear which SSD1306 driver you are using. The official driver does have a |
Beta Was this translation helpful? Give feedback.
I am not clear which SSD1306 driver you are using. The official driver does have a
poweron()method here.