Skip to content

Commit b4e2fb4

Browse files
committed
Merge pull request arduino#298 from Kolbi/patch-1
Update WeatherStationSensor.ino
2 parents a91be50 + 9bc7f1c commit b4e2fb4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

libraries/MySensors/examples/WeatherStationSensor/WeatherStationSensor.ino

+13-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*/
3838

3939
// Enable debug prints to serial monitor
40-
#define MY_DEBUG
40+
//#define MY_DEBUG
4141

4242
// Enable and select radio type attached
4343
#define MY_RADIO_NRF24
@@ -227,9 +227,11 @@ bool updatePressureSensor()
227227
{
228228
changed = true;
229229
lastPressureTemp = temperature;
230+
#ifdef MY_DEBUG
230231
Serial.print(F("Temperature = "));
231232
Serial.print(temperature);
232233
Serial.println(metric ? F(" *C") : F(" *F"));
234+
#endif
233235
if (!send(tempMsg.set(lastPressureTemp, 1)))
234236
{
235237
lastPressureTemp = -1.0;
@@ -240,9 +242,11 @@ bool updatePressureSensor()
240242
{
241243
changed = true;
242244
lastPressure = pressure;
245+
#ifdef MY_DEBUG
243246
Serial.print(F("sealevel Pressure = "));
244247
Serial.print(pressure);
245248
Serial.println(F(" hPa"));
249+
#endif
246250
if (!send(pressureMsg.set(lastPressure, 1)))
247251
{
248252
lastPressure = -1.0;
@@ -253,8 +257,10 @@ bool updatePressureSensor()
253257
{
254258
changed = true;
255259
lastForecast = forecast;
260+
#ifdef MY_DEBUG
256261
Serial.print(F("Forecast = "));
257262
Serial.println(weatherStrings[forecast]);
263+
#endif
258264
if (send(forecastMsg.set(weatherStrings[lastForecast])))
259265
{
260266
if (!send(forecastMsg2.set(lastForecast)))
@@ -271,8 +277,10 @@ bool updatePressureSensor()
271277
{
272278
changed = true;
273279
lastSituation = situation;
280+
#ifdef MY_DEBUG
274281
Serial.print(F("Situation = "));
275282
Serial.println(situationStrings[situation]);
283+
#endif
276284
if (!send(situationMsg.set(lastSituation, 0)))
277285
{
278286
lastSituation = -1.0;
@@ -302,8 +310,10 @@ bool updateHumiditySensor()
302310
}
303311

304312
changed = true;
313+
#ifdef MY_DEBUG
305314
Serial.print(F("T: "));
306315
Serial.println(temperature);
316+
#endif
307317
if (!send(msgTemp.set(temperature, 1)))
308318
{
309319
lastTemp = -1.0;
@@ -322,8 +332,10 @@ bool updateHumiditySensor()
322332
{
323333
lastHum = humidity;
324334
changed = true;
335+
#ifdef MY_DEBUG
325336
Serial.print(F("H: "));
326337
Serial.println(humidity);
338+
#endif
327339
if (!send(msgHum.set(lastHum, 1)))
328340
{
329341
lastHum = -1.0;

0 commit comments

Comments
 (0)