Piano Random Beeps Bug Hunt! Test your Troubleshooting.

This code will upload to Code Piano, but it won’t run as you expect it to. Can you find out what’s causing the problem?

//Buggy: Play a random tone on Piano that changes every loop void setup(){ pinMode(10,OUTPUT); //Set the speaker as an OUTPUT } void loop(){ tone(10,random(800,40)); //Select a random hertz value from 40 to 799 to play delay(150); //delay 150 milliseconds before the next random tone is played } // (c) 2018 Let's Start Coding. License: www.letsstartcoding.com/bsdlicense
 



Need a hint? Click here.