mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-05 12:54:57 +00:00
Added comments
This commit is contained in:
@@ -7,24 +7,24 @@
|
||||
DHT dht(DHTPIN, DHTTYPE);
|
||||
|
||||
void setup() {
|
||||
//initialize serial communication and the sensors
|
||||
Serial.begin(9600);
|
||||
dht.begin();
|
||||
pinMode(MQ5_PIN, INPUT);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
delay(500);
|
||||
|
||||
float h = dht.readHumidity();
|
||||
float t = dht.readTemperature();
|
||||
|
||||
int mq5Value = analogRead(MQ5_PIN);
|
||||
|
||||
// if sensor isn't connected properly display error message
|
||||
if (isnan(h) || isnan(t)) {
|
||||
Serial.println("Fout bij het lezen van de sensor!");
|
||||
return;
|
||||
}
|
||||
|
||||
// puts sensor values in the serial monitor
|
||||
Serial.print("Luchtvochtigheid: ");
|
||||
Serial.print(h);
|
||||
Serial.print(" %\tTemperatuur: ");
|
||||
@@ -33,4 +33,6 @@ void loop() {
|
||||
|
||||
Serial.print("MQ5 waarde: ");
|
||||
Serial.println(mq5Value);
|
||||
|
||||
delay(500);
|
||||
}
|
Reference in New Issue
Block a user