FeatherClock is a project for the Adafruit Feather HUZZAH ESP8266 or the ESP32-based Adafruit Feather HUZZAH32, both running running MicroPython.
It is an attempt to replicate my Electric Imp clock project. It uses the Adafruit FeatherWing four-digit, seven-segment LED add-on, or the equivalent 16 x 8 matrix LED add-on.
Currently, the clock has no remote control, which the Electric Imp Platform makes very easy to implement, but is rather less so here. You can set preferences, though. Adding a web UI, served locally or remotely, lies in a future phase of the project.
The project makes use of the HT16K33-Python library.
pyboard.py
from GitHub.esptool.py
using brew install esptool
nano /usr/local/bin/esptool.py
ls /dev/cu*
esp32-20210902-v1.17.bin
.esptool.py --chip esp32 --port <FEATHER_DEVICE_PATH> erase_flash
esptool.py --chip esp32 --port <FEATHER_DEVICE_PATH> --baud 460800 write_flash -z 0x1000 esp32-20210902-v1.17.bin
esptool.py --port <FEATHER_DEVICE_PATH> erase_flash
esptool.py --port <FEATHER_DEVICE_PATH> --baud 460800 write_flash --flash_size=detect 0 esp8266-20210902-v1.17.bin
cd featherclock
./install.sh <FEATHER_DEVICE_PATH>
Enter
to continue or Q
to quit.For now, the clock’s settings are applied by sending over a prefs.json
file with any or all of the following values:
{ "mode": <true/false>, # 24-hour (true) or 12-hour (false)
"colon": <true/false>, # Show a colon between the hours and minutes readouts
"flash": <true/false>, # Flash the colon symbol, if it's shown
"bright": 10, # Display brightness from 1 (dim) to 15 (bright)
"bst": <true/false> } # Auto-adjust for Daylight Saving Time
Having installed pyboard.py
as above, you send over prefs file using:
pyboard.py -d <FEATHER_DEVICE_PATH> -f cp prefs.json :prefs.json
The install.sh
script also copies this over.
To get <FEATHER_DEVICE_PATH>
, you can add my Z Shell function dlist() to your .zshrc
file. After restarting your terminal, you can run:
pyboard.py -d $(dlist) -f cp prefs.json :prefs.json
You can view FeatherClock’s source code at GitHub.
install.sh
.esptool.py
installation instructions.dlist()
link.pyboard.py
.prefs.json
over if it is present in the working directory.prefs.json
).