Skip to content

Commit 9326161

Browse files
committed
Fix formatting and spelling in PressureSensor.ino
1 parent 8b4f418 commit 9326161

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

examples/PressureSensor/PressureSensor.ino

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
// #define BATTERY_POWERED // Just remove the two slashes at the beginning of this line if your node is battery powered. It will then go into deep sleep as much as possible. While it's sleeping it can't work as a repeater!
6565

6666
// Would you like the sensor to generate a weather forecast based on the barometric pressure?
67-
#define GENERATE_FORECAST // Just remove the two slashes at the beginning of this line to enable this feature.
67+
#define GENERATE_FORECAST
6868

6969

7070
// LIBRARIES
@@ -81,13 +81,13 @@ const float ALTITUDE = 14; // Change this value to your l
8181
unsigned long BME280measurementInterval = 60000; // Sleep time between reads for the BME sensor (in ms). Keep this value at 60000 if you have enabled the forecast feature, as the forecast algorithm needs a sample every minute.
8282
#define COMPARE_TEMP 1 // Send temperature only if it changed? 1 = Yes 0 = No. Can save battery.
8383
float tempThreshold = 0.1; // How big a temperature difference has to minimally be before an update is sent. Makes the sensor less precise, but also less jittery, and can save battery.
84-
#define COMPARE_HUM 1 // Send temperature only if changed? 1 = Yes 0 = No. Can save battery.
84+
#define COMPARE_HUM 1 // Send humidity only if changed? 1 = Yes 0 = No. Can save battery.
8585
float humThreshold = 0.1; // How big a humidity difference has to minimally be before an update is sent. Makes the sensor less precise, but also less jittery, and can save battery.
86-
#define COMPARE_BARO 1 // Send temperature only if changed? 1 = Yes 0 = No. Can save battery.
86+
#define COMPARE_BARO 1 // Send barometric pressure only if changed? 1 = Yes 0 = No. Can save battery.
8787
float presThreshold = 0.1; // How big a barometric difference has to minimally be before an update is sent. Makes the sensor less precise, but also less jittery, and can save battery.
8888

8989

90-
//VARIABLES YOU PROBABLY SHOULDN'T CHANGE
90+
// VARIABLES YOU PROBABLY SHOULDN'T CHANGE
9191
#define TEMP_CHILD_ID 0 // for MySensors. Within this node each sensortype should have its own ID number.
9292
#define HUM_CHILD_ID 1 // for MySensors. Within this node each sensortype should have its own ID number.
9393
#define BARO_CHILD_ID 2 // for MySensors. Within this node each sensortype should have its own ID number.
@@ -114,7 +114,7 @@ enum FORECAST
114114
int lastForecast = -1; // Stores the previous forecast, so it can be compared with a new forecast.
115115
const int LAST_SAMPLES_COUNT = 5;
116116
float lastPressureSamples[LAST_SAMPLES_COUNT];
117-
int minuteCount = 0; // Helps the forecst algorithm keep time.
117+
int minuteCount = 0; // Helps the forecast algorithm keep time.
118118
bool firstRound = true; // Helps the forecast algorithm recognise if the sensor has just been powered up.
119119
float pressureAvg; // Average value is used in forecast algorithm.
120120
float pressureAvg2; // Average after 2 hours is used as reference value for the next iteration.
@@ -271,8 +271,8 @@ void loop() {
271271
}
272272
#endif
273273

274-
Serial.println("BME280 - Measurement complete. Going to wait until next measurement.");
275-
BME280shouldAsk = true; // Ready for the new round.
274+
Serial.println("BME280 - Measurement complete. Going to wait until next measurement.");
275+
BME280shouldAsk = true; // Ready for the new round.
276276
}
277277

278278
#ifdef BATTERY_POWERED
@@ -281,7 +281,7 @@ void loop() {
281281
unsigned long quicktimecheck = millis(); // To check how much time has passed since the beginning of being awake, and then calculate from that how long to sleep until the next intended measuring time, we need to know how many milliseconds have passed.
282282
unsigned long sleeptime = BME280measurementSleepTime - (quicktimecheck - previousBME280Millis); // How much time has passed already during the calculating? Subtract that from the intended interval time.
283283
Serial.println("BME280 - zzzzZZZZzzzzZZZZzzzz");
284-
sleep (sleeptime);
284+
sleep(sleeptime);
285285
Serial.println("BME280 - Waking up.");
286286
}
287287
#endif
@@ -398,8 +398,7 @@ int sample(float pressure) {
398398
else if ((dP_dt > (-0.25)) && (dP_dt < (-0.05))) {
399399
forecast = CLOUDY;
400400
}
401-
else if ((dP_dt > 0.05) && (dP_dt < 0.25))
402-
{
401+
else if ((dP_dt > 0.05) && (dP_dt < 0.25)) {
403402
forecast = SUNNY;
404403
}
405404
else if ((dP_dt >(-0.05)) && (dP_dt < 0.05)) {

0 commit comments

Comments
 (0)