experimental.screensaver
A simple screensaver implementation for EuroPi
@author Chris Iverach-Brereton <ve4cib@gmail.com> @year 2023
- class experimental.screensaver.OledWithScreensaver(enable_screensaver=True, enable_blank=True)
A wrapper for europi.oled that provides automatic screensaver & blank if enabled
The notify_user_interaction() method should be called in the ISR for any events that should interrupt or defer the screensaver/blank
Set .enable_screensaver or .enable_blank to False to disable the screensaver/blanking activation completely (though if you do that, just use europi.oled instead of this class)
- Parameters
enable_screensaver – If true, the screensaver will activate when needed
enable_blank – If true, the screen will blank after the screensaver has been active for a while
- is_blank()
Is the screen blanked due to inactivity?
Is the screensaver currently showing?
- notify_user_interaction()
Notifies the screensaver subsystem that the user has physically interacted with the module and that the screensaver should defer/shutdown as appropriate
- class experimental.screensaver.Screensaver
A screensaver for the EuroPi
This class’ draw() function should be called from inside the application’s main loop to draw the screensaver.
At regular intervals the EuroPi logo will be drawn to a random location on the screen.
Alternatively draw_blank() will simply clear the screen
- draw(force=False)
Draw the logo to a random position on the screen
If the current ticks_ms is an even multiple of the screensaver interval, or the force paramter is True, we will draw. Otherwise this does nothing
- Parameters
force – Force the logo to be drawn, regardless of the current ticks
- draw_blank()
Blank the screen completely