@@ -34,7 +34,7 @@ float fever_temp = 100.4;
34
34
float temp_offset = 0.5 ;
35
35
36
36
// Sensor read delay, in minutes
37
- int sensor_delay = 5 ;
37
+ int sensor_delay = 1 ;
38
38
39
39
// Measuring your armpit temperature for a minimum of 12 minutes
40
40
// is equivalent to measuring your core body temperature.
@@ -119,34 +119,41 @@ void loop() {
119
119
Serial.print (" Temp: " );
120
120
#if defined(TEMPERATURE_F)
121
121
float temp = tempsensor.readTempF ();
122
+ // add temperature offset
123
+ temp += temp_offset;
122
124
Serial.print (temp);
123
125
Serial.println (" *F." );
124
126
#elif defined(TEMPERATURE_C)
125
127
float temp = tempsensor.readTempC ();
128
+ // add temperature offset
129
+ temp += temp_offset;
126
130
Serial.print (temp);
127
131
Serial.println (" *C." );
128
132
#else
129
133
#warning "Must define TEMPERATURE_C or TEMPERATURE_F!"
130
134
#endif
131
135
132
- // add temperature offset
133
- temp += temp_offset;
134
-
136
+ // set NeoPixels to RED if fever_temp
135
137
if (temp >= fever_temp) {
136
138
pixels.setPixelColor (1 , pixels.Color (255 , 0 , 0 ));
137
139
pixels.show ();
138
140
}
139
141
142
+ // float to buffer
140
143
snprintf (temperature_buf, sizeof (temperature_buf) - 1 , " %0.*f" , 1 , temp);
144
+
141
145
if (calibration_time == 0 ) {
146
+ Serial.println (" Writing to UART" );
142
147
// write to UART
143
148
bleuart.write (temperature_buf);
144
149
}
145
150
else {
151
+ Serial.print (" Calibration time:" );
152
+ Serial.println (calibration_time);
146
153
calibration_time-=1 ;
147
154
}
148
155
149
- // shutdown MCP9808 - power consumption ~0.1 mikro Ampere
156
+ // shutdown MSP9808 - power consumption ~0.1 mikro Ampere
150
157
Serial.println (" Shutting down MCP9808" );
151
158
tempsensor.shutdown_wake (1 );
152
159
0 commit comments