Bug Hunt! Test your Troubleshooting.

You may have already run into some errors in modifying or writing your own code. Don't worry, studies have shown that almost half of all code 'compiles' result in an error! 

The code below has some errors sprinkled in it. Before you run the code, read through it and look for the errors, called bugs. Can you find them? Try to fix each one and then see if the code runs. 

/* * Flash the siren lights of Code Car on and off together */ void setup() { // pinMode(5,OUTPUT); set your blue siren light as an OUTPUT pinMode(6,OUTPUT); //set your red siren light as an OUTPUT } void loop() { digitalWrite(5,HIGH); //Turn on pin 5 digitalWrite(6,LOW); //Turn off pin 6 delay(1000); //wait 1000 milliseconds digitalWrite(5,LOW); //Turn off power to pin 5 digitalWrite(6,HIGH); //Turn on pin 6 delay(1000); } // (c) 2022 Let's Start Coding. License: www.letsstartcoding.com/bsdlicense
 



Need a hint? Click here.