I am learning the language of Arduino. In doing so, I am trying several methods of data output. To learn this, I have a simple sketch I need to answer my question.
Using the Blink program. I want to be able to blink the LED 8 times, and do it in different ways of control.
I have tried a couple of methods, using "IF" and "FOR", but I get no change, the LED blinks continuously. Now, I am good at electronics, just not up to speed on programming C. I am sorta dumb, so please don't make fun of my sketch, just tell me how to do this more efficiently, and correctly. It compiled without errors, just didn't do the job I was trying to do. This helps me learn the "Control" commands, and how to format them correctly. I think that is the issue here, but, not sure. Can ya'll please help me out?
Here is one of my programs:
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;
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;
}
