Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macropad hotkeys: Add screensaver mode to prevent OLED burn-in #2883

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

flavio-fernandes
Copy link
Contributor

This commit introduces a screensaver mode to the Adafruit Macropad hotkeys script, addressing issue #2882.

Key Changes:

  • Screensaver Activation: Added a new configurable parameter SCREENSAVER_START_TIME, which specifies the duration of inactivity (in seconds) before the screensaver activates.
  • Class-Level Variables: Introduced class-level variables in the App class to track the last activity time, screensaver mode status, and breathing effect brightness.
  • Screensaver Functions: Added helper functions:
    • enter_screensaver_mode(): Turns off the OLED display and LEDs, entering screensaver mode.
    • wake_from_screensaver(): Exits screensaver mode and restores the previous state of the display and LEDs.
    • screensaver_breathing_effect(): Implements a breathing LED effect during screensaver mode.
  • Main Loop Integration: Modified the main loop to monitor inactivity and trigger the screensaver mode based on the specified timeout.

This update ensures the Macropad’s OLED display is protected from burn-in during extended periods of inactivity.

Fixes #2882.

@flavio-fernandes
Copy link
Contributor Author

/cc @PaintYourDragon PTAL

This commit introduces a screensaver mode to the Adafruit Macropad
hotkeys script, addressing issue adafruit#2882.

Key Changes:
- Screensaver Activation: Added a new configurable parameter
  SCREENSAVER_START_TIME, which specifies the duration of inactivity
  (in seconds) before the screensaver activates.
- Class-Level Variables: Introduced class-level variables in the App
  class to track the last activity time, screensaver mode status, and
  breathing effect brightness.
- Screensaver Functions: Added helper functions:
  * enter_screensaver_mode(): Turns off the OLED display and LEDs,
    entering screensaver mode.
  * wake_from_screensaver(): Exits screensaver mode and restores the
    previous state of the display and LEDs.
  * screensaver_breathing_effect(): Implements a breathing LED effect
    during screensaver mode.
- Main Loop Integration: Modified the main loop to monitor inactivity
  and trigger the screensaver mode based on the specified timeout.

This update ensures the Macropad's OLED display is protected from
burn-in during extended periods of inactivity.

Fixes issue adafruit#2882.
Signed-off-by: Flavio Fernandes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential for Display Burn-In in MACROPAD Hotkeys Guide
1 participant