mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-05 12:54:57 +00:00
Compare commits
2 Commits
12c25b33a7
...
3525479b17
Author | SHA1 | Date | |
---|---|---|---|
|
3525479b17 | ||
|
2e08bf7e74 |
@@ -7,24 +7,24 @@
|
|||||||
DHT dht(DHTPIN, DHTTYPE);
|
DHT dht(DHTPIN, DHTTYPE);
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
//initialize serial communication and the sensors
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
dht.begin();
|
dht.begin();
|
||||||
pinMode(MQ5_PIN, INPUT);
|
pinMode(MQ5_PIN, INPUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
delay(500);
|
|
||||||
|
|
||||||
float h = dht.readHumidity();
|
float h = dht.readHumidity();
|
||||||
float t = dht.readTemperature();
|
float t = dht.readTemperature();
|
||||||
|
|
||||||
int mq5Value = analogRead(MQ5_PIN);
|
int mq5Value = analogRead(MQ5_PIN);
|
||||||
|
|
||||||
// if sensor isn't connected properly display error message
|
// if sensor isn't connected properly display error message
|
||||||
if (isnan(h) || isnan(t)) {
|
if (isnan(h) || isnan(t)) {
|
||||||
Serial.println("Fout bij het lezen van de sensor!");
|
Serial.println("Fout bij het lezen van de sensor!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// puts sensor values in the serial monitor
|
||||||
Serial.print("Luchtvochtigheid: ");
|
Serial.print("Luchtvochtigheid: ");
|
||||||
Serial.print(h);
|
Serial.print(h);
|
||||||
Serial.print(" %\tTemperatuur: ");
|
Serial.print(" %\tTemperatuur: ");
|
||||||
@@ -33,4 +33,6 @@ void loop() {
|
|||||||
|
|
||||||
Serial.print("MQ5 waarde: ");
|
Serial.print("MQ5 waarde: ");
|
||||||
Serial.println(mq5Value);
|
Serial.println(mq5Value);
|
||||||
|
|
||||||
|
delay(500);
|
||||||
}
|
}
|
@@ -14,8 +14,6 @@ void setup() {
|
|||||||
while (1);
|
while (1);
|
||||||
}
|
}
|
||||||
Serial.println("SGP30 sensor gevonden!");
|
Serial.println("SGP30 sensor gevonden!");
|
||||||
|
|
||||||
sgp.setIAQBaseline(0x8973, 0x8AAE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
Reference in New Issue
Block a user