1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| // include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
int temps;
int seconde;
unsigned long previousMillis;
void setup() {
}
void loop() {
unsigned long currentMillis = millis();
temps = millis();
seconde = temps/100;
if (currentMillis - previousMillis >= 5000) {
// save the last time you blinked the LED
previousMillis = currentMillis;
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a initial message to the LCD.
lcd.print("Info1");
lcd.setCursor(0, 1);
lcd.print(seconde);
delay(10);
}
lcd.clear();
if (currentMillis - previousMillis >= 5000) {
// save the last time you blinked the LED
previousMillis = currentMillis;
lcd.begin(16, 2);
// Print a initial message to the LCD.
lcd.print("Info2");
lcd.setCursor(0, 1);
lcd.print("Test");
delay(10);
}
} |
Partager