Rocket Countdown sequence Bug Hunt! Test your Troubleshooting.

This code will upload, but it doesn’t work like the project before it. Even if you can spot the error before uploading, upload the bad code to see what happens.

// Buggy: Countdown to takeoff, then light the boosters and use static as your engine noise void setup(){ //the countdown only happens once when the board is turned on pinMode(2,OUTPUT); //speaker pinMode(3,OUTPUT); //LED pinMode(4,OUTPUT); //LED pinMode(5,OUTPUT); //LED pinMode(6,OUTPUT); //LED pinMode(9,OUTPUT); //Booster pinMode(10,OUTPUT); //Booster } void loop(){ digitalWrite(6,HIGH); //Turn on LED digitalWrite(5,HIGH); //Turn on LED digitalWrite(4,HIGH); //Turn on LED digitalWrite(3,HIGH); //Turn on LED delay(3000); digitalWrite(6,LOW); //Start the countdown by turning off LED 6 tone(2,800); delay(1000); //Wait 1 second digitalWrite(5,LOW); tone(2,700); delay(1000); //Wait 1 second digitalWrite(4,LOW); tone(2,600); delay(1000); //Wait 1 second digitalWrite(3,LOW); tone(2,500); delay(1000); //Wait 1 second digitalWrite(9,HIGH); // turn on LED9 digitalWrite(10,HIGH); //turn on LED10 //the 'flying' actions repeat inside the loop tone(2,150); //playing two similar tones really close together makes a rumbling sound like an engine delay(1); tone(2,50); delay(1); } // (c) 2018 Let's Start Coding. License:

Need a hint? Click here.