mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-05 12:54:57 +00:00
Name change and small changes
This commit is contained in:
@@ -20,8 +20,8 @@ void loop() {
|
||||
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!");
|
||||
if (isnan(h) || isnan(t) || isnan(mq5Value)) {
|
||||
Serial.println("Fout bij het lezen van de sensors!");
|
||||
return;
|
||||
}
|
||||
// puts sensor values in the serial monitor
|
@@ -1,31 +1,31 @@
|
||||
#include <M5Stack.h>
|
||||
#include <Wire.h>
|
||||
#include "Adafruit_SGP30.h"
|
||||
|
||||
Adafruit_SGP30 sgp;
|
||||
|
||||
void setup() {
|
||||
M5.begin();
|
||||
Serial.begin(9600);
|
||||
|
||||
|
||||
if (!sgp.begin()) {
|
||||
Serial.println("SGP30 sensor niet gevonden :(");
|
||||
while (1);
|
||||
}
|
||||
Serial.println("SGP30 sensor gevonden!");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
delay(1000);
|
||||
|
||||
if (!sgp.IAQmeasure()) {
|
||||
Serial.println("Error bij meting!");
|
||||
return;
|
||||
}
|
||||
Serial.print("eCO2: ");
|
||||
Serial.print(sgp.eCO2);
|
||||
Serial.print(" ppm\tTVOC: ");
|
||||
Serial.print(sgp.TVOC);
|
||||
Serial.println(" ppb");
|
||||
#include <M5Stack.h>
|
||||
#include <Wire.h>
|
||||
#include "Adafruit_SGP30.h"
|
||||
|
||||
Adafruit_SGP30 sgp;
|
||||
|
||||
void setup() {
|
||||
M5.begin();
|
||||
Serial.begin(9600);
|
||||
|
||||
|
||||
if (!sgp.begin()) {
|
||||
Serial.println("SGP30 sensor niet gevonden :(");
|
||||
while (1);
|
||||
}
|
||||
Serial.println("SGP30 sensor gevonden!");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
delay(1000);
|
||||
|
||||
if (!sgp.IAQmeasure()) {
|
||||
Serial.println("Error bij meting!");
|
||||
return;
|
||||
}
|
||||
Serial.print("eCO2: ");
|
||||
Serial.print(sgp.eCO2);
|
||||
Serial.print(" ppm\tTVOC: ");
|
||||
Serial.print(sgp.TVOC);
|
||||
Serial.println(" ppb");
|
||||
}
|
Reference in New Issue
Block a user