-
Notifications
You must be signed in to change notification settings - Fork 1
binary_clock
The binary_clock
module is designed to display the time in a binary format. It loads a UI on a touchscreen.
The UI looks like this:
The user can tap the screen to show and hide the decimal representation of the time that is shown underneath.
The time is sourced from the internal clock: localTime = time.localtime(time.time() + self.UTC_OFFSET)
This module relies on the ntptime micropython module to set the internal clock correctly. It syncs time on boot from the "0.nz.pool.ntp.org" ntp server (Hardcoded)
The UTC_OFFSET
is used to adjust the time to the local time zone. It is currently hardcoded.
UTC_BASE_OFFSET = 12 * 60 * 60
UTC_OFFSET = 12 * 60 * 60
This module has very primitive (date based) support for daylight savings time. It is currently hardcoded.
if (doy < 92 or doy > 268): # 2 April, 25 Sept
self.UTC_OFFSET = self.UTC_BASE_OFFSET + 3600
The hardware I used when developing this module was this screen, designed for the D1 Mini: https://www.aliexpress.com/item/32919729730.html
"TFT 2.4 Touch Shield V1.0.0 for LOLIN (WEMOS) D1 mini 2.4" inch 320X240 SPI Touch Screen ILI9341 XPT2046"
I used a S2 Mini as the main controller: https://www.wemos.cc/en/latest/s2/s2_mini.html
I 3d printed a case to hold the screen: Thingiverse Link
At the moment there are no config options for this module. All the pins are hardcoded.
This module provides no telemtry data for other modules to use.
This module consumes no telemetry from other modules.
This module does not provide any commands to other modules.
This module responds to touch commands. If the screen is touched, it toggles the display of the time in decimal format.
Commands:
-
/touch
- This command toggles the display of the time in decimal format.