You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kempt-kinkajou-2023/cybergarden-sensor/lib/Sensors/Sensors.cpp

29 lines
457 B

#include <Sensors.h>
float Sensor::temperatureSensor(){
return analogRead(TEMP_SENS);
}
float Sensor::humiditySensor(){
float h = dht->readHumidity();
if (isnan(h)) {
return -1;
}
else{
return h;
}
}
int Sensor::photoSensor(){
int value = analogRead(PHOTO_SENS);
return value;
}
int Sensor::vibroSensor(){
int value = analogRead(VIBRO_SENS);
return value;
}