Capteur Humidité Avec Contacteur - Français - Arduino Forum
Maybe your like
Bonjour, Je souhaiterai allumer ou éteindre un ventilateur suivant le pourcentage d humidité dans l air. Je ne trouve pas le problème dans le programme.. Mais le contacteur ne change pas d état... Si vous voyez quelque chose.. help
MAMIE.ino (1.3 KB)
kamill April 4, 2021, 8:39am 2Bonjour,
Pourquoi mettre une chaine de caractère ici?
if ("Humidity >59.00"){C'est tout simplement
if (Humidity >59.00){Mets ton code entre balises de code
bozzlight April 4, 2021, 8:43am 3Bonjour, merci pour votre réponses. si je l écrit comme vous me le dite, j ai une erreur qui apparait:
^~~~~~~~ exit status 1 'Humidity' was not declared in this scope
bozzlight April 4, 2021, 9:00am 4Code:
// Install GitHub - adafruit/DHT-sensor-library: Arduino library for DHT11, DHT22, etc Temperature & Humidity Sensors in arduino/librairies // Install GitHub - adafruit/Adafruit_Sensor: Common sensor library in arduino/Adafruit_Sensor #include "DHT.h" #define DHTPIN 2 #define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
void setup() { Serial.begin(9600); Serial.println("DHTxx test!"); dht.begin(); pinMode(9,OUTPUT); } void loop() {
delay(2000);
float h = dht.readHumidity(); float t = dht.readTemperature(); float f = dht.readTemperature(true);
if (isnan(h) || isnan(t) || isnan(f)) { Serial.println("Failed to read from DHT sensor!"); return; }
if (Humidity >59.00){ digitalWrite(9, HIGH); }
if (Humidity <59.00){ digitalWrite(9, LOW); }
// Calcul de l'indice de temperature en Farenheit float hif = dht.computeHeatIndex(f, h); // Calcul de l'indice de temperature en Celsius float hic = dht.computeHeatIndex(t, h, false);
//Affichages : Serial.print("Humidite: "); Serial.print(h); Serial.print(" %\t"); Serial.print("Temperature: "); Serial.print(t); Serial.print(" *C "); Serial.print(f); Serial.print(" *F\t"); Serial.print("Indice de temperature: "); Serial.print(hic); Serial.print(" *C "); Serial.print(hif); Serial.println(" *F");
}
kamill April 4, 2021, 9:16am 5C'est le nom de la variable qu'il faut mettre. Elle s'appelle h
if (h >59.00){Mets ton code entre balises de code.
bozzlight April 4, 2021, 9:19am 6toujours le meme probleme:
MAMIE:41:16: error: expected primary-expression before ')' token
if (h <59.00%){
^
exit status 1
expected primary-expression before ')' token
bozzlight April 4, 2021, 9:30am 7merci pour les infos:
// Install https://github.com/adafruit/DHT-sensor-library in arduino/librairies // Install https://github.com/adafruit/Adafruit_Sensor in arduino/Adafruit_Sensor #include "DHT.h" #define DHTPIN 2 #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); void setup() { Serial.begin(9600); Serial.println("DHTxx test!"); dht.begin(); pinMode(9,OUTPUT); } void loop() { delay(2000); float h = dht.readHumidity(); float t = dht.readTemperature(); float f = dht.readTemperature(true); if (isnan(h) || isnan(t) || isnan(f)) { Serial.println("Failed to read from DHT sensor!"); return; } if (h >59.00%){ digitalWrite(9, HIGH); } if (h <59.00%){ digitalWrite(9, LOW); } // Calcul de l'indice de temperature en Farenheit float hif = dht.computeHeatIndex(f, h); // Calcul de l'indice de temperature en Celsius float hic = dht.computeHeatIndex(t, h, false); //Affichages : Serial.print("Humidite: "); Serial.print(h); Serial.print(" %\t"); Serial.print("Temperature: "); Serial.print(t); Serial.print(" *C "); Serial.print(f); Serial.print(" *F\t"); Serial.print("Indice de temperature: "); Serial.print(hic); Serial.print(" *C "); Serial.print(hif); Serial.println(" *F"); } bozzlight April 4, 2021, 9:39am 8ca y est! merci merci beaucoup
system Closed August 2, 2021, 9:39am 9This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.
Related topics
| Topic | Replies | Views | Activity |
|---|---|---|---|
| programme capteur d'humidité Français | 3 | 1743 | May 6, 2021 |
| Problème de code Français | 25 | 3302 | May 6, 2021 |
| (projet arrosage) Question par rapport au programme de la pompe Français | 17 | 976 | May 6, 2021 |
| à lock Français | 6 | 1134 | May 6, 2021 |
| Controllo umidità incubatrice Software | 11 | 3096 | May 7, 2021 |
Tag » Arduino Isnan(h)
-
Isnan() | Cộng đồng Arduino Việt Nam
-
Using Isnan - Programming Questions - Arduino Forum
-
Problems With Isnan And Serial - Arduino Forum
-
Simple Code Question - Programming Questions - Arduino Forum
-
Writing Program For NaN Condition - Arduino Forum
-
Error: 'isnan' Was Not Declared In The Scope - Arduino Forum
-
Arduino: Read Temperature From DHT11 Module - C# Corner
-
[Solved] Error: 'isnan' Was Not Declared In This Scope Isnan(n)
-
Isnan - C++ Reference
-
Phần 1: Arduino Căn Bản Với Esp8266 → Nhiệt độ Và độ ẩm DHT
-
Arduino With IstSOS — IstSOS 2.4.0-RC4 Documentation
-
DHT11/DHT22 Temperature And Humidity Sensor Using Arduino IDE