63
63
#define DHTPOWERPIN 8
64
64
65
65
66
- // Sleep time between sensor updates (in milliseconds) to add to sensor delay (read from sensor data; tipically : 1s)
66
+ // Sleep time between sensor updates (in milliseconds) to add to sensor delay (read from sensor data; typically : 1s)
67
67
static const uint64_t UPDATE_INTERVAL = 60000 ;
68
68
69
69
// Force sending an update of the temperature after n sensor reads, so a controller showing the
@@ -74,13 +74,13 @@ static const uint8_t FORCE_UPDATE_N_READS = 10;
74
74
75
75
#define CHILD_ID_HUM 0
76
76
#define CHILD_ID_TEMP 1
77
- #define CHILD_ID_TEMP_HI 2
77
+ #define CHILD_ID_HEATINDEX 2
78
78
79
79
// Set this offset if the sensors have permanent small offsets to the real temperatures/humidity.
80
80
// In Celsius degrees or moisture percent
81
81
#define SENSOR_HUM_OFFSET 0 // used for temperature data and heat index computation
82
82
#define SENSOR_TEMP_OFFSET 0 // used for humidity data
83
- #define SENSOR_TEMP_HI_OFFSET 0 // used for heat index data
83
+ #define SENSOR_HEATINDEX_OFFSET 0 // used for heat index data
84
84
85
85
86
86
@@ -99,13 +99,13 @@ uint8_t nNoUpdates = FORCE_UPDATE_N_READS; // send data on start-up
99
99
bool metric = true ;
100
100
float temperature;
101
101
float humidity;
102
- float temperatureHI ;
102
+ float heatindex ;
103
103
104
104
105
105
106
106
MyMessage msgHum (CHILD_ID_HUM, V_HUM);
107
107
MyMessage msgTemp (CHILD_ID_TEMP, V_TEMP);
108
- MyMessage msgTempHI (CHILD_ID_TEMP_HI , V_TEMP);
108
+ MyMessage msgHeatIndex (CHILD_ID_HEATINDEX , V_TEMP);
109
109
110
110
111
111
@@ -153,11 +153,11 @@ void presentation()
153
153
// Send the sketch version information to the gateway
154
154
sendSketchInfo (SN, SV);
155
155
// Register all sensors to gw (they will be created as child devices)
156
- present (CHILD_ID_HUM, S_HUM, " Umidity " );
156
+ present (CHILD_ID_HUM, S_HUM, " Humidity " );
157
157
wait (100 ); // to check: is it needed
158
158
present (CHILD_ID_TEMP, S_TEMP, " Temperature" );
159
159
wait (100 ); // to check: is it needed
160
- present (CHILD_ID_TEMP_HI , S_TEMP, " Heat Index" );
160
+ present (CHILD_ID_HEATINDEX , S_TEMP, " Heat Index" );
161
161
metric = getControllerConfig ().isMetric ;
162
162
}
163
163
@@ -245,17 +245,17 @@ void loop()
245
245
if (fabs (humidity - lastHum)>=0.05 || fabs (temperature - lastTemp)>=0.05 || nNoUpdates >= FORCE_UPDATE_N_READS) {
246
246
lastTemp = temperature;
247
247
lastHum = humidity;
248
- temperatureHI = computeHeatIndex (temperature,humidity); // computes Heat Index, in *C
248
+ heatindex = computeHeatIndex (temperature,humidity); // computes Heat Index, in *C
249
249
nNoUpdates = 0 ; // Reset no updates counter
250
250
#ifdef MY_DEBUG
251
251
Serial.print (" Heat Index: " );
252
- Serial.print (temperatureHI );
252
+ Serial.print (heatindex );
253
253
Serial.println (" *C" );
254
254
#endif
255
255
256
256
if (!metric) {
257
257
temperature = 1.8 *temperature+32 ; // convertion to *F
258
- temperatureHI = 1.8 *temperatureHI +32 ; // convertion to *F
258
+ heatindex = 1.8 *heatindex +32 ; // convertion to *F
259
259
}
260
260
261
261
#ifdef MY_DEBUG
@@ -275,9 +275,9 @@ if (fabs(humidity - lastHum)>=0.05 || fabs(temperature - lastTemp)>=0.05 || nNoU
275
275
#ifdef MY_DEBUG
276
276
wait (100 );
277
277
Serial.print (" Sending HeatIndex: " );
278
- Serial.print (temperatureHI );
278
+ Serial.print (heatindex );
279
279
#endif
280
- send (msgTempHI .set (temperatureHI + SENSOR_TEMP_HI_OFFSET , 2 ));
280
+ send (msgHeatIndex .set (heatindex + SENSOR_HEATINDEX_OFFSET , 2 ));
281
281
282
282
}
283
283
0 commit comments