The following are some questions related to this project along with some suggested code challenges. The idea is to provoke thought, test your understanding, and get you coding!
While the sketches provided in this guide work, there is room for improvement and additional features. Have fun playing with the provided code to see what you can do with it.
- How would this code behave if the Circuit Playground had more than 10 NeoPixels? How about less?
- What is the maximum amount of time that the timer can be set for?
- Why is
time.sleep()called before setting the NeoPixel colors in the loop?
- For the Arduino version, why were floats used in the Fading Hourglass sketch for the RGB values? (hint: what does
int value = 5/3;give?) In CircuitPython, what's the difference between evaluating
5 / 3and
5 // 3?
cpx.play_tone()to add an audio alarm when the countdown ends.
- Change the fade effect to be non-linear.
- Allow for a flip reset during the count period.