int ledPin = 13; // LED connected to digital pin 13
int count = 1; // Keeps count of which number it's on
void setup() {
pinMode(ledPin, OUTPUT); // set pin 13 as output
}
void loop() {
for (int i = 0; i < count; i++) {
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
}
count++; // increments count
if (count > 5) { // if count reaches 5, then start over from 1
count = 1;
}
delay(1500); // delay between next blinking sequence
}
Count Blink with Brute Force
int ledPin = 13; // LED connected to digital pin 13
int count = 1; // Keeps count of which number it's on
void setup() {
pinMode(ledPin, OUTPUT); // set pin 13 as output
}
void loop() {
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
delay(1500); // delay between next blinking sequence
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
delay(1500); // delay between next blinking sequence
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
delay(1500); // delay between next blinking sequence
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
delay(1500); // delay between next blinking sequence
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(200);
delay(1500); // delay between next blinking sequence
}
No comments:
Post a Comment