ClockSketch V7 - Part I
Introduction: ClockSketch V7 - Part I
This Instructable is about v7 of the sketch running on many of the things I've published. As many identical questions scattered across various things are a bit less than ideal I've decided to upload v7 as a thing on it's own.
June 2022 Update
Occassionally some people using ESP8266 MCUs end up with heavy flickering/glitching on the LED strip. This is caused by a combination of WS2812B types and the "bitbanged output" used in the sketch. While trying to figure this out I came across a few things you might want to have a look at: https://www.reddit.com/r/FastLED/comments/viem4p/my_quest_for_flicker_some_oddities/
May 2022 Update
Uploaded v7.2 of all sketches for 7 segment models, this one adds optional fading effects. Enable them by uncommenting "FADING" on top of the sketch, also check the options further down inside the sketch (roughly lines #192, where the other options like brightness levels are configured).
Also added Lazy Grid Clock v2 / Grid Clock v2, both will fade all changing pixels, no differentiation between dots/digits.
March 2022 Update
Added v7.1 of all sketches. When using autoDST setting date/time could be a bit tricky, depending on what time the clock is set in combination with how much offset there is to UTC. This could lead to a wrong date written to the RTC. This was visible in the serial output (1 day off) - but if one missed this.... anyways, added a workaround. Also autoDST will now display the adjusted date in the serial output, something like this should be more obvious now.
24.09.2021 Update / Info
Please note that there's some problems using esp8266/v3 and FastLED in certain configurations. That's not a problem of this sketch and there's not much I can do about it. There's a lot of threads about this on github(fastled/esp core), here's a few examples:
https://github.com/esp8266/Arduino/issues/8054
https://github.com/FastLED/FastLED/issues/1264
I am using esp8266 core v2.7.1 and didn't encounter these issues. 1014
So if you're using v3 (check using the boards manager inside the Arduino IDE) a rollback to 2.x might solve issues with flickering leds, especially if it's only the first one. Updates down below (Step 12, "Basic Troubleshooting").
---
This Instructable will also add some notes to ldr/rtc/nodemcu things, so I recommend reading this before building one of my designs.
I will upload sketches for many of my designs after adapting/testing v7 on them. The ones that get v7 will also be updated accordingly but redirect to this Instructable for downloads.
Also planned is "Part II" of this Instructable - a few words about customizing the sketch and/or adapting it to other strip layouts. One of the goals when doing v7 was making the sketch even easier to adapt to different led strip layouts.
I've chosen to add animated GIFs instead of short segments of youtube videos. This is also a great way to avoid off topic comments on videos.... ^^
While resolution/fps are low the purpose is to illustrate some aspects, not showing 4k high def button presses.
Note:
While working on this Instructable the "Full Preview" stopped working. So I'll be working/editing on this a few times after publishing, there might be a few small changes...
Supplies
For this Instructable one of the supported/tested clocks is required.
Step 1: A Few Words About V7 / Features
Up to v6 there's been many changes over the past years to my sketch. After designing various led displays/clocks with unique led routing inside I always had to somehow adapt the sketch to this. After adding the optional support for nodeMCU/ESP8266 the whole thing got a bit cluttered, so v7 is a complete rework. Technically this means there hasn't been a v6, it was just a "pre-release"... ^^
While reaching ~610 lines before this one is much bigger at ~2000 lines. This doesn't matter for the ones simply using it on my designs, everything is pre-configured to work right away on the configurations shown in the instructions.
Many of the things changed in this sketch won't be really visible to many - but there's been a lot of changes to how the clocks did work so far. 1014