Close

The Software

A project log for Clap-Activated Applause Machine

Clap on a machine that claps for you! So efficient!

dillon-nicholsDillon Nichols 08/07/2019 at 23:111 Comment

The code is available on Github as a gist:

https://gist.github.com/dwaq/35bf46b9d76081fec116b856d3b7ecda

It is licensed under a Creative Commons Attribution 3.0 Unported License.

This code is simple enough (and there's a ton of comments), but I'll still provide a brief overview. As a reminder, this code is for the Arduino Uno.

The setup() function is line 85. Here we set up all the pins and attach an interrupt to the microphone. There's also various Serial prints throughout the code that I commented out but can be enabled to get a better idea of what is going on.

Line 118 is the loop() function. Because I do the majority of my code in functions or interrupts, I made the loop() function only run once a millisecond. This code just takes care of the time between detecting claps and runs the machine to clap.

soundDetected() on line 54 is called when the microphone detects sound. It sets some flags that are used inside the loop(). It also contains a flag to do some debouncing of the microphone input. If you recall, it's very noisy, and I debounce it here instead of adding a capacitor across the pins on the board.

The next function is my clapAlgorithim() on line 37. You'll have to read the code yourself to see what that does ;).

Final code is the clapWithDelay() function on line 101 that spins the motor one rotation and makes the hands clap.

I hope you found this description useful! I'd be happy to help with any questions related to the code.

Discussions

zwaengend wrote 05/28/2020 at 13:35 point

It is a very nice website. A very good blog page has just gone through my eyes. Keep sharing more blog pages like that in the best regards of software and now I can easily check https://www.myassignmentwriting.com.au/write-my-essay-in-australia/ to manage the task. Software are getting more updates with days. Software engineers are doing enormous work in this regard.

  Are you sure? yes | no