Questions and Code Challenges

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.

Questions

  • 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 delay() or 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 / 3 and 5 // 3?

Code Challenges

  • Use playTone() or 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.
This guide was first published on Dec 29, 2016. It was last updated on Dec 29, 2016. This page (Questions and Code Challenges) was last updated on Jan 22, 2018.