Simple Arduino Project

Intro: Simple Arduino Project

code :

int led =4;
int led2=8;

int led3=5;
int led4=2; int b=7;

void setup() {

pinMode(led,OUTPUT);

pinMode(led2,OUTPUT);

pinMode(led3,OUTPUT);

pinMode(led4,OUTPUT);

pinMode(b,INPUT);

}

void loop() { if (digitalRead(b)==HIGH){

digitalWrite(led,HIGH);

delay(1000); digitalWrite(led2,HIGH);

delay(1000); digitalWrite(led3,HIGH);

delay(1000); digitalWrite(led4,HIGH);

delay(1000); digitalWrite(led,LOW);

delay(1000); digitalWrite(led2,LOW);

delay(1000); digitalWrite(led3,LOW);

delay(1000); digitalWrite(led4,LOW);

delay(1000); }}

Share

    Recommendations

    • Furniture Contest 2018

      Furniture Contest 2018
    • Fix It! Contest

      Fix It! Contest
    • Metalworking Contest

      Metalworking Contest

    Discussions