Piano Button Pitch Changer Bug Hunt! Test your Troubleshooting.
If you can spot this bug without uploading, you can practically see into the future! You may even have to play with the uploaded buggy code for a while to see what’s wrong with it.
If you can spot this bug without uploading, you can practically see into the future! You may even have to play with the uploaded buggy code for a while to see what’s wrong with it.
If you watched this project's code walkthrough video, you'll remember the emphasis on making sure that the pitch variable didn't go below 0 into 'unhearable range'. In this bug, the if statement that stops pitch from falling below 40 is gone! If you held down the 'drop the pitch' button for a while, you probably noticed you couldn't hear the tone anymore and if you pressed the 'raise the pitch' button, you had to wait a long time for the pitch to rise back into 'hearable' range.
Can you replace the 'if' statement that keeps pitch from falling below 40 without peeking back at the project example code?