Utilisateur:Lucien

De Wiki Fab Lab Onl'Fait
Aller à la navigation Aller à la recherche

Je suis un élève de 2em année d'électronique et je suis venu a FAB LAB pour créer une balise de température

08/04/2022:

entraînement a la programmation sur bread board (feux de circulation)

/*

  Blink

  Turns on an LED on for one second, then off for one second, repeatedly.

  This example code is in the public domain.

  • /


// Pin 13 has an LED connected on most Arduino boards.

// give it a name:

int led_verte = 11;

int led_jaune = 2;

int led_rouge = 13;

int led_pert = 12;

int led_pouge = 3;

// the setup routine runs once when you press reset:

void setup()

{                

  // initialize the digital pin as an output.

  pinMode(led_verte, OUTPUT);

  pinMode(led_jaune, OUTPUT);

  pinMode(led_rouge, OUTPUT);     

}

// the loop routine runs over and over again forever:

void loop() {

  digitalWrite(led_rouge, HIGH);   // turn the LED on (HIGH is the voltage level)

  delay(1000);                     // wait for 6 second

  digitalWrite(led_pert, HIGH);    // turn the LED on (HIGH is the voltage level)

  delay(4000);                     // wait for 4 second

  digitalWrite(led_pert, LOW);    // turn the LED off by making the voltage LOW

  digitalWrite(led_pouge, HIGH);   // turn the LED on (HIGH is the voltage level)

  delay(1000);                     // wait for a second

  digitalWrite(led_rouge, LOW);    // turn the LED off by making the voltage LOW

  digitalWrite(led_jaune, HIGH);   // turn the LED on (HIGH is the voltage level)

  delay(1500);                     // wait for a second

  digitalWrite(led_jaune, LOW);    // turn the LED off by making the voltage LOW

  digitalWrite(led_verte, HIGH);   // turn the LED on (HIGH is the voltage level)

  delay(6000);                     // wait for a second

  digitalWrite(led_verte, LOW);    // turn the LED off by making the voltage LOW

  digitalWrite(led_jaune, HIGH);   // turn the LED on (HIGH is the voltage level)

  delay(1500);                     // wait for a second

  digitalWrite(led_jaune, LOW);    // turn the LED off by making the voltage LOW

  digitalWrite(led_pouge, LOW);    // turn the LED off by making the voltage LOW

 

}