-
Notifications
You must be signed in to change notification settings - Fork 0
05 ‐ Display Modes and Push Buttons
The clock has 5 different display modes for how the minutes are displayed on the clock. The default display mode at boot can be configured in the Settings.h file, but it can be changed to any valid mode. Even though the clock boots into this mode, the display mode can be changed via a push button (see below) or by sending an MQTT message to the /dispmode topic. The MQTT payload for each mode is listed below, alongside the mode desscription. See the wiki MQTT page for more details on MQTT topcis and payloads.
In this mode, an additional LED is lit for each minute of the hour. All prior LEDs remain lit so at minute 59, all 60 minute LEDs will be lit. When the hour rolls over, all LEDs except for the 0/60 minute LED at the top will be turned off. This mode has an additional option called "Sweep" which is described below.
This mode only lights up the current minute of the hour. All other minute LEDs are turned off.
This mode will light up a five LED segment, with the first LED in the segment indicating the current minute with four trailing LEDs. The five segments will travel around the clock as the hour progresses, spanning across the top of the hour.
This is similar to the five minute LED segment, except that 10 LEDs are used for the segment. The first LED in the segment indicates the current minute, with nine trailing LEDs.
This is identical to the five and ten minute segment displays, except it uses 15 LEDs for the segement with the first LED indicating the current minute, followed by 14 trailing LEDs.
You can opt to have the current minute LED blink off and on at an interval speficied in the settings. By default, the light will toggle from on to off and then back from off to on at an interval of 1 second (a total of 2 seconds for the full cycle). This can be enable or disabled at any time via MQTT.
When enabled and the full minutes display is active, the LEDs will 'redraw' each time the minute changes. The LEDs will all turn off briefly and then relight in order from minute 0 to the current minute in a "sweeping" display. At the top of the hour when time rolls over from minute 59 to minute 60/0, all the lights will turn back off in a 'reverse sweep' (e.g. counter clockwise) until only minute 60/0 is lit. The process then begins again for the new hour. This option can be disabled in the Settings.h file or changed at any time via an MQTT message.
The clock as built has three push buttons on the back. These are referred to in the code as RED_BUTTON (button 1), YELLOW_BUTTON (button 2) and GREEN_BUTTON (button 3). The default action for each press of these buttons are as follows:
Red Button:
Runs the LED self-test. All minute LEDs will light in order, followed by each hour LED. After the test, the clock will return to the time display.
Yellow Button:
The yellow button will toggle through the different display modes, 0-4. After display mode 4, it will cycle back through to display mode 0.
Green Button:
The green button will toggle all LEDs off and on. When off, the clock continues to run and when the LEDs are toggled back on, the current time will be displayed. Note that toggling the lights off/on can also be done via MQTT, which means they can be automated.