As mentionned in the article, each fireflies has a clock that drives when they decide to flash.

each firefly has its own individual internal clock

A clock in this case is like a counter, so we will start by adding a clock variable to our program.

and every time the clock “strikes twelve”, it flashes.

We can use a forever loop to repeat code that increments the clock.
When the clock reaches "noon" (let's pick 8), we turn on the NeoPixels briefly and turn them off to simulate a flash.

This guide was first published on Oct 11, 2017. It was last updated on Oct 11, 2017.

This page (The Clock) was last updated on Oct 11, 2017.

Text editor powered by tinymce.