You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.1 KiB

// intégration de la bibliothèque
#include <LiquidCrystal.h>
int cpt, i=1;
int max = 21;
int buzzer = 6;
// initialisation de la bibliothèque LCD
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// Le LCD a 16 char sur 2 lignes
lcd.begin(16, 2);
pinMode(buzzer, OUTPUT);
// Envoi d'un message au LCD
lcd.print("Compteur");
lcd.setCursor(0, 1);
lcd.print(" ");
attachInterrupt(0,emergencyStop,FALLING);
Serial.begin(9600);
}
void minTemp() {
digitalWrite(buzzer, 600);
}
// void loop() {
// for(;i < max; i++) {
// lcd.setCursor(0, 1);
// lcd.print(i);
// delay(500);
// lcd.print(" ");
// }
// lcd.clear();
// lcd.print("Compteur fini !");
// }
void loop() {
sensorValue = analogRead(A0);
lcd.setCursor(0, 1);
lcd.print(sensorValue);
lcd.print(" ")
}
// Modifiez votre code pour que la première ligne affiche “Compteur” et la deuxième ligne affiche un compteur de 1 à 20 s'incrémentant toutes les secondes.
// Faites afficher ce compteur tout à droite de la deuxième ligne.