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

Popular posts from this blog

4 Stage Timer With DS3231RTC Module.

Interfacing KY038 sound sensor with Raspberry pi Pico

Interfacing MQ2 Gas & Smoke Sensor With Raspberry Pi Pico