Sunday 30 October 2011

Arduino scare trick or treaters

How to scare trick or treaters with a delayed evil laugh when the door is opened.

Items required
Arduino
Surface door contact
10K Resistor
Speakers

Connect the door contact to pin 2 and 5v with a pull down 10k resistor connected to pin2 And ground
Connect the speakers (mono) to pin 11 and ground

Extra software required:

Sox or Audacity :to convert MP3 to wav 8bit
http://sox.sourceforge.net/
http://audacity.sourceforge.net/

You will need to convert the file using  sox audiodump.wav -c 1 -r 8000 -u -b evillaugh.wav

Wav2c : used to convert the audio wav file to code as seen at bottom of the code below (https://github.com/olleolleolle/wav2c)

Code

https://github.com/catchcoder/arduino