First, read Nick Gammon's post at the top of this Forum on how to properly post source code using code tags:
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // put your setup code here, to run once:
}
void loop() {
int i; // put your main code here, to run repeatedly:
i == 0; // THIS IS NOT AN ASSIGNMENT OPERATOR, IT'S A TEST FOR EQUALITY. USE SINGLE =
do {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(250); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
} while (i <= 8);
++i; // HOW CAN THIS CHANGE IF IT'S OUTSIDE THE LOOP???
}
You have a while loop inside loop(), which seems redundant. What if you changed things to:
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // put your setup code here, to run once:
Serial.begin(9600); // Serial object to let us "see" stuff...
}
void loop() {
static int i = 0; // static keyword means this statement is executed only once at load time
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(250); // wait for a quarter second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
i++;
if (i % 8 == 0 && i > 0) { // Only pause every 8 times
Serial.println("Pass completed");
delay(2000);
}
}
Now, walk through each line and ask what it does to determine how the code works. Also, make sure your comments really do what you say. The first delay() is only a quarter second.