Skip to content
Snippets Groups Projects
Commit 4abf1c75 authored by Stefan Gehr's avatar Stefan Gehr
Browse files

Revert "function 3 in 1"

This reverts commit f259e6c9.
parent 28e80c39
No related branches found
No related tags found
No related merge requests found
...@@ -39,48 +39,6 @@ UPDATESTATE t1up(float* temp) { ...@@ -39,48 +39,6 @@ UPDATESTATE t1up(float* temp) {
return SUCCESS; return SUCCESS;
} }
struct temperatureSensor
{
float tempValue;
uint32_t prevTime;
uint32_t currentTime;
uint32_t errorTime;
DHT sensorClass;
};
temperatureSensor t1down{ 0.0, 0,0 ,0, DHT(T1DOWN, DHT11) };
temperatureSensor t2up{ 0.0, 0,0 ,0, DHT(T2UP, DHT11) };
temperatureSensor t2down{ 0.0, 0,0 ,0, DHT(T2DOWN, DHT11) };
UPDATESTATE temperatureSensor(temperatureSensor& sensor)
{
sensor.currentTime = millis();
if (sensor.currentTime - sensor.prevTime < TEMPUPDATETIME)
{
return UNCHANGED;
}
float tmpTemperature = sensor.sensorClass.readTemperature();
if (isnan(tmpTemperature))
{
if(sensor.errorTime)
{
if (sensor.currentTime - sensor.errorTime > ERRORTIME)
{
return LONG_TIME_ERROR;
}
}
else
{
return ERROR;
}
}
sensor.tempValue = tmpTemperature;
sensor.errorTime = 0;
sensor.prevTime = sensor.currentTime;
return SUCCESS;
}
// DOWN temperature for solar system 1 // DOWN temperature for solar system 1
static DHT dhtT1down(T1DOWN, DHT11); static DHT dhtT1down(T1DOWN, DHT11);
UPDATESTATE t1down(float* temp) { UPDATESTATE t1down(float* temp) {
...@@ -169,3 +127,4 @@ void temperatureBegin(void) { ...@@ -169,3 +127,4 @@ void temperatureBegin(void) {
dhtT2up.begin(); dhtT2up.begin();
dhtT2down.begin(); dhtT2down.begin();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment