/* * This code plays "Jesus Loves Me" while different LEDs blink with each note. * * Setup for song in code from: * http://web.media.mit.edu/~leah/LilyPad/07_sound.html * * For a chart of the frequencies of different notes see: * http://www.phy.mtu.edu/~suits/notefreqs.html * */ int speakerPin = 11; // speaker connected to digital pin 11 void beep (unsigned char speakerPin, int frequencyInHertz, long timeInMilliseconds) // the sound producing function { int x; long delayAmount = (long)(1000000/frequencyInHertz); long loopTime = (long)((timeInMilliseconds*1000)/(delayAmount*2)); for (x=0;x