LED Circle Cycle 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. 

/* Cycle LEDs 3, 4, 5, and 6 in a circle continuously */ void setup() { // set the circle LEDs as output pinMode(3,OUTPUT); pinMode(4,OUTPUT); pinMode(5,OUTPUT); pinMode(6,OUTPUT); } void loop() { for(int i=3; i>=6; i++){ //Starting with LED3 and up to LED6... digitalWrite(i,HIGH); //turn on the LED equal to the variable 'i' delay(50); //wait 50 milliseconds digitalWrite(i,LOW); //turn off the LED delay(50); //wait 50 milliseconds } /* After the 'for' loop runs, it will increase 'i' to the next number and use that number for the LED pin to light next. This repeats for 3,4,5,6 and then resets to 3 */ } // (c) 2018 Let's Start Coding. License: www.letsstartcoding.com/bsdlicense

Need a hint? Click here.