Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Matat 2020 Youtube
- int hygrometre = A0; // pin de l'hygromètre
- float valeur = 0;
- float calcul;
- void setup() {
- Serial.begin(115200);
- }
- void loop() {
- // read the value from the sensor:
- valeur = analogRead(hygrometre);
- calcul = ((1-((valeur-510) /(1024-510)))*100);
- Serial.print(calcul);
- Serial.println("% d'humidité");
- delay(500);
- }
- //510 min 1024
- //5-7 minutes d'initialisation
- //vcc->5v
- //gnd->gnd
- //A0-> pin analogique de la carte
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement