Étape 3: Arduino Code
Copiez le code ci-dessous vers un nouveau document de l’arduino. Sélectionnez votre Conseil d’administration et le Port, puis consulter les résultats.
#include < LiquidCrystal.h >
Innovente lcd (12, 11, 5, 4, 3, 2) ;
void setup() {}
LCD.Begin (16, 2) ;
}
void loop() {}
double a = analogRead(A0) ;
a = (a / 1023) * 100 ;
String str ;
Str=String(a) ;
lcd.setCursor (0, 0) ;
LCD.Print("") ; MOYEN SIMPLE DE CLEAR LCD
lcd.setCursor (0, 0) ;
LCD.Print ("LUX:" + str + « % ») ;
un = analogRead(A1) ;
Str=String(a) ;
lcd.setCursor (0, 1) ;
LCD.Print("") ;
lcd.setCursor (0, 1) ;
LCD.Print ("TEMP:" + str) ;
Delay(1000) ;
}