Speaker Variable Tone Bug Hunt! Test your Troubleshooting.

//Use a variable to increase the pitch on Speaker every time the loop runs void setup(){ pinMode(10,OUTPUT); //set the speaker as an OUTPUT } void loop(){ int pitch = 40; //create an integer variable named 'pitch'. Start its value at 40 tone(10,pitch); //Play 'pitch' on the speaker. On the first loop, it will equal 40 delay(3); //delay 3 milliseconds with a pitch playing pitch = pitch + 10 ; //increase pitch variable by 10 before restarting the loop } // (c) 2018 Let's Start Coding. License: www.letsstartcoding.com/bsdlicense

Need a hint? Click here.