sparkfun / SparkFun_Qwiic_OLED_Arduino_Library

Arduino Library for SparkFun's OLED Qwiic (I²C) boards
https://docs.sparkfun.com/SparkFun_Qwiic_OLED_Arduino_Library/introduction/
Other
6 stars 7 forks source link

SSD1306 sleep mode #5

Closed adamgarbo closed 2 years ago

adamgarbo commented 2 years ago

Hi folks,

The SSD1306 used in the SparkFun Qwiic OLED Display has an available sleep mode (see page 14 of datasheet below) that can be accessed by issuing an 0xAE command. I've been reviewing the library and from what I can tell, the "dev-like" commands are currently not publically accessible. Any chance we can enable sleep functionality, or at least the ability to issue custom commands?

Datasheet: https://datasheet.lcsc.com/szlcsc/1809291515_Shenzhen-Allvision-Tech-QG-2832TLBFG02_C91220.pdf

Cheers, Adam

ghost commented 2 years ago

Good idea - I'll add a power display on/off method - easy to do.

ghost commented 2 years ago

I added a method to turn the OLED on or off - displayPower()

Docs: https://sparkfun.github.io/SparkFun_Qwiic_OLED_Arduino_Library/api_device/#displaypower

It's at the head of the main branch. Will be part of next release.

adamgarbo commented 2 years ago

Thanks, @kirk-sfe!

I'll be sure to kick the tires! It'll be interesting to see how low the sleep current goes with the sleep mode enabled. Also, a great feature to save the screen for long deployments.

adamgarbo commented 2 years ago

As a quick update, I measured the current draw with oled.displayPower(0); and it's approximately 1.2 uA at 3.3V (~4 uW). Super helpful way to reduce the sleep current.