I like clocks, many of my projects have some type of clock or a clock display. This is my first project posting to hackster.io, I've thought about posting before, but just never did - So when I saw that M5Stack was running a watch contest and wanted it posted here, I thought, ok I like clocks, and ok, I've never used hackster I guess it's about time. :-)
This is my entry - a "Simple" binary clock using the M5StickC.
Binary Clocks are fun, and can confuse people, but really are pretty simple. Most use dots, or some other display for the bits, this one is a bit different, using the value of the bit as the display. IE: 10100 Which is 20 is displayed as 16 _ 4 _ _ (The _ are just empty spaces).
This makes it easier to use, but it's also confusing if you don't know what you are looking at. It's simple, just add the numbers on the line up to get the time.
The 1st line of the display is for hours, the 2nd for minutes, and the 3rd is for seconds
I think the only required library is the ArduinoJson library, which can be found in the library manager. I think the other libraries are all included in the board core.
You will need the ESP32 board cores installed. If you haven't done that before instructions can be found here: https://github.com/espressif/arduino-esp32
You just need to add your wifi ssid, and wifi password to lines 47 and 48. And upload the sketch to the M5StickC.
The sketch uses http://worldtimeapi.org to do a best guess of your location, it then sets the timezone offset, and grabs the time from the NTP server. It then sets the RTC (and resets the RTC once a hour to adjust for any drift that may happen).
After that, you'll get a display that looks like the above - you just need to add the numbers up to read the time. - That it, simple.
Comments