Piano Rising & Falling Tone Bug Hunt! Test your Troubleshooting.

A simple reversed character is going to cause all kinds of buggy problems in this program. Can you find it before you upload? If not, your ears will definitely tell you something is wrong!

// Create a rising and then falling tone on the Piano void setup(){ pinMode(10,OUTPUT); //Set the speaker as an OUTPUT } void loop(){ for(int i = 40; i>800; i++){ //start at 40 hertz and play a new tone up to 800 hertz tone(10,i); //play the tone that is equal to the variable 'i' delay(3); //delay 3 milliseconds before checking the for loop condition again } for(int i = 800; i>40; i--){ //starting at 800 hertz and going down to 40 hertz tone(10,i); //play a tone equal to variable 'i' delay(3); //delay 3 milliseconds before checking the for loop condition again } } // (c) 2018 Let's Start Coding. License: www.letsstartcoding.com/bsdlicense
 



Need a hint? Click here.