RpiBacklight v0.2.1 RpiBacklight.AutoDimmer View Source

A simple automatic screen blanker.

AutoDimmer can be started under a supervision tree and it will take care to dim and poweroff the display. By default the timeout is 10 seconds and the brightness level is 255, the maximum allowed.

Is responsibity of the user to call activate/0 to keep the light active, for example on input events from keyboard or mouse. Everytime activate/0 is called, the timeout is reset.

AutoDimmer can be configured with optional parameters, they are:

  • :timeout - the blank timeout in seconds, 10 by default.

  • :brightness - the brightness when active, from 0 to 255, 255 by default.

For example: RpiBacklight.AutoDimmer.start_link(timeout: 30, brightness: 127) will kick in 30 seconds by setting half of the maximum brightness possible.

Link to this section Summary

Functions

Signal the dimmer to activate the backlight

Returns a specification to start this module under a supervisor

Link to this section Functions

Signal the dimmer to activate the backlight.

If backlight is already on, restarts the timer.

Returns a specification to start this module under a supervisor.

See Supervisor.