Good afternoon!
I breaded to make a battery-powered watch with an OLED SSD1306 screen on an ESP 32 that goes into deep sleep. I managed to send the board to sleep, but at the moment when the board falls asleep the screen continues to light. Tell me how you can turn off the screen when the board falls asleep
You could use a mosfet to be sure the display can’t draw any more power
yes, I thought about it, the question is, after esp wakes up the display needs to be initialized? If I remove the power from the display while the board is on and then return it back, it will not work
These commands should help:
display.ssd1306_command(SSD1306_DISPLAYOFF);
display.ssd1306_command(SSD1306_DISPLAYON);
With a little more research I think you will find your objective.
1 Like
These don’t seem to be valid anymore. For anyone looking into the correct commands to turn off an OLED display use the display_on
and display_off
methods:
display:
- platform: ssd1306_i2c
id: oled_display
switch:
- platform: template
turn_on_action:
then:
- lambda: |-
id(oled_display).turn_on();
turn_off_action:
then:
- lambda: |-
id(oled_display).turn_off();
2 Likes