Write the following using C language for program in Arduino:
const int led1 = 2;
const int led2 = 3;
const int led3 = 4;
const int led4 = 5;
void setup() {
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
pinMode(led3,OUTPUT);
pinMode(led4,OUTPUT);
}
void loop() {
digitalWrite(led1, HIGH);
delay(1000);
digitalWrite(led1, LOW);
delay(1000);
digitalWrite(led2, HIGH);
delay(1000);
digitalWrite(led2, LOW);
delay(1000);
digitalWrite(led3, HIGH);
delay(1000);
digitalWrite(led3, LOW);
delay(1000);
digitalWrite(led4, HIGH);
delay(1000);
digitalWrite(led4, LOW);
delay(1000);
}
Get Answers For Free
Most questions answered within 1 hours.