Interfacing LED with Arduno Micro
int i;
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
}
void loop() {
for (i = 2; i <= 7; i++) {
digitalWrite(i, HIGH);
delay(100);
digitalWrite(i, LOW);
delay(100);
}
for (int i = 7; i > -2; i--){
digitalWrite(i, HIGH);
delay(100);
digitalWrite(i, LOW);
}
}
Comments
Post a Comment