arduino Feu Rouge

                                                          Feu Rouge     
  • Composants
1. Arduino uno

2- 3 LED (vert ,rouge,orange)



3-plaquette d'essai

  • Schéma




  • Code

int counter;


void setup()

{

  pinMode(4, OUTPUT);

  pinMode(3, OUTPUT);

  pinMode(2, OUTPUT);

}


void loop()

{

  digitalWrite(4, HIGH);

  delay(2000); // Wait for 2000 millisecond(s)

  digitalWrite(4, LOW);

  for (counter = 0; counter < 4; ++counter) {

    digitalWrite(3, HIGH);

    delay(200); // Wait for 200 millisecond(s)

    digitalWrite(3, LOW);

    delay(200); // Wait for 200 millisecond(s)

  }

  digitalWrite(2, HIGH);

  delay(2000); // Wait for 2000 millisecond(s)

  digitalWrite(2, LOW);

}


Commentaires