Skip to content

Commit 5b0ba2f

Browse files
small changes
to conform to coding standards
1 parent ab6b868 commit 5b0ba2f

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

examples/PMS-7003 dust sensor

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@
6060
// Choose if you want this sensor to also be a repeater.
6161
// #define MY_REPEATER_FEATURE // Just remove the two slashes at the beginning of this line to also enable this sensor to act as a repeater for other sensors. If this node is on battery power, you probably shouldn't enable this.
6262

63-
// Are you using this sensor on battery power?
64-
// #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!
65-
6663
#include <SPI.h>
6764
#include <MySensors.h>
6865
#include <SoftwareSerial.h>
@@ -81,7 +78,6 @@ MyMessage msgDust100(CHILD_ID_DUST_PM100, V_LEVEL); // Sets up the message forma
8178
MyMessage msgDust100b(CHILD_ID_DUST_PM100, V_UNIT_PREFIX);
8279

8380

84-
8581
// These defines and variables can be changed:
8682
int dustSlowDown = 20; // The dust sensor is internally checked approximately every 700 or 800 milliseconds. Once in how many loops should it send the data?
8783
unsigned long dustMeasurementInterval = 700; // This is a fickle thing. Changing it can give more time-outs.
@@ -110,7 +106,6 @@ uint16_t checksum;
110106
int dustSlowDownCounter = 0;
111107

112108

113-
114109
void presentation()
115110
{
116111
// Send the sketch version information to the gateway and Controller
@@ -126,7 +121,8 @@ void presentation()
126121
}
127122

128123

129-
void setup() {
124+
void setup()
125+
{
130126
Serial.begin(115200);
131127
delay(1000);
132128
mySerial.begin(9600);
@@ -135,7 +131,8 @@ void setup() {
135131
}
136132

137133

138-
void loop() {
134+
void loop()
135+
{
139136

140137
// The dust sensor sends its data continuously, so let's catch that data.
141138
int dustSensorOutput = pms7003ReadData();
@@ -291,10 +288,10 @@ int pms7003ReadData() {
291288

292289
// Time to send the results to the gateway.
293290
dustSlowDownCounter = dustSlowDownCounter + 1;
294-
if(dustSlowDownCounter > dustSlowDown){
291+
if(dustSlowDownCounter > dustSlowDown) {
295292

296293
/* MEASUREMENT */
297-
if(rawGt1_0um > 0){
294+
if(rawGt1_0um > 0) {
298295
Serial.println(" Dust1_0 = " + String(concPM1_0_CF1));
299296
send(msgDust10.set(concPM1_0_CF1,1));
300297
}
@@ -309,27 +306,27 @@ int pms7003ReadData() {
309306

310307
/* RAW DATA */
311308
/*
312-
if(rawGt0_3um > 0){
309+
if(rawGt0_3um > 0) {
313310
Serial.println(" Dust03 = " + String(rawGt0_3um));
314311
send(msgDust03.set(rawGt0_3um,1));
315312
}
316-
if(rawGt0_5um > 0){
313+
if(rawGt0_5um > 0) {
317314
Serial.println(" Dust05 = " + String(rawGt0_5um));
318315
send(msgDust05.set(rawGt0_5um,1));
319316
}
320-
if(rawGt1_0um > 0){
317+
if(rawGt1_0um > 0) {
321318
Serial.println(" Dust10 = " + String(rawGt1_0um));
322319
send(msgDust10.set(rawGt1_0um,1));
323320
}
324-
if(rawGt2_5um > 0){
321+
if(rawGt2_5um > 0) {
325322
Serial.println(" Dust25 = " + String(rawGt2_5um));
326323
send(msgDust25.set(rawGt2_5um,1));
327324
}
328-
if(rawGt5_0um > 0){
325+
if(rawGt5_0um > 0) {
329326
Serial.println(" Dust50 = " + String(rawGt5_0um));
330327
send(msgDust50.set(rawGt5_0um,1));
331328
}
332-
if(rawGt10_0um > 0){
329+
if(rawGt10_0um > 0) {
333330
Serial.println(" Dust100 = " + String(rawGt10_0um));
334331
send(msgDust100.set(rawGt10_0um,1));
335332
}

0 commit comments

Comments
 (0)