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.
62 lines
1.3 KiB
62 lines
1.3 KiB
// intégration de la bibliothèque
|
|
#include <LiquidCrystal.h>
|
|
|
|
int cpt, i=1;
|
|
int max = 21;
|
|
float tempValue;
|
|
|
|
// int buzzer = 6;
|
|
|
|
float sensorValue;
|
|
|
|
// 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,minTemp,FALLING);
|
|
|
|
// Serial.begin(9600);
|
|
}
|
|
|
|
// void loop() {
|
|
// for(;i < max; i++) {
|
|
// lcd.setCursor(0, 1);
|
|
// lcd.print(i);
|
|
// delay(500);
|
|
// lcd.print(" ");
|
|
// }
|
|
// lcd.clear();
|
|
// lcd.print("Compteur fini !");
|
|
// }
|
|
|
|
|
|
// void minTemp() {
|
|
// digitalWrite(buzzer, 600);
|
|
// }
|
|
|
|
// void loop() {
|
|
// sensorValue = analogRead(A0);
|
|
// tempValue = (((sensorValue * 5.0) / 1024.0) - 0.5) * 100.0;
|
|
// lcd.setCursor(0, 1);
|
|
// lcd.print(tempValue);
|
|
// lcd.print(" ");
|
|
// delay(50);
|
|
// }
|
|
|
|
void loop() {
|
|
tone(9, 1000);
|
|
}
|
|
|
|
|
|
// // 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.
|