(Note: This is a x-post from Coding Grace)
This project was during the "you better remember to wash your hands for 20s" back in April. But I wanted to post it here as well to share with folks.
Everyone has a wee song to sing to while washing your hands for 20 seconds, since I had Adafruit's Circuit Playground Express handy, why not create a visual countdown.
π You will need:
- 1 x Circuit Playground Express (aka CPX)
- 1 x MicroUSB to USB cable (so the CPX can talk to your computer)
- Laptop
- Editor of choice, I chose Mu Editor as it recognises Adafruit components and quick way to change and upload code as well as debugging, etc.
- CircuitPython for CPX installed
- Battery to power the CPX
π§ Why did I choose Adafruit's Circuit Playground Express?
I had one around and I wanted to put something useful on it, plus I want to play a little more with CircuitPython. The CPX has 10 bright LEDS (Neopixels) so perfect for the 20 second countdown.
It also has a "Microphone Audio Sensor" so it can pick up sounds. And there's already code handily written on detecting sound via Adafruit's Sound example.
βΉοΈ More info about CPX
Check out the guided tour of the CPX here: https://learn.adafruit.com/adafruit-circuit-playground-express/guided-tour
All the elements are there, so let's get started! πͺ
π€ What I wanted to do
- Clap hands to initiate the countdown
- Changes colour and flashes a couple of times to let you know it heard your clap, and it gives you time to turn on tap, get soup on your hands
- Each Neopixel comes on for the 1st 10 seconds going clockwise, as it reaches the end, all Neopixels turns off and each one lights up going counter-clockwise.
- When 20 seconds are done, it flashes to turn on all Neopixels to green (one colour) to state that you have comepleted the required time to wash your hands.
πΈ Some pics
π Result
π½ Here's a video of it working, my hands were sore from clapping while testing so I tapped it loudly on the casing which registers the sound as well. π
βΉοΈ Source code for project
Here's the code on github: https://github.com/whykay/cpx_clap_wash
Top comments (0)