Simple Arduino Project

Introduction: 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); }}

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Be the First to Share

    Recommendations

    • Backyard Contest

      Backyard Contest
    • Silly Hats Speed Challenge

      Silly Hats Speed Challenge
    • Arduino Contest 2020

      Arduino Contest 2020

    Discussions