You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/PMS-7003 dust sensor
+12-15Lines changed: 12 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -60,9 +60,6 @@
60
60
// Choose if you want this sensor to also be a repeater.
61
61
// #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.
62
62
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
-
66
63
#include <SPI.h>
67
64
#include <MySensors.h>
68
65
#include <SoftwareSerial.h>
@@ -81,7 +78,6 @@ MyMessage msgDust100(CHILD_ID_DUST_PM100, V_LEVEL); // Sets up the message forma
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?
87
83
unsigned long dustMeasurementInterval = 700; // This is a fickle thing. Changing it can give more time-outs.
@@ -110,7 +106,6 @@ uint16_t checksum;
110
106
int dustSlowDownCounter = 0;
111
107
112
108
113
-
114
109
void presentation()
115
110
{
116
111
// Send the sketch version information to the gateway and Controller
@@ -126,7 +121,8 @@ void presentation()
126
121
}
127
122
128
123
129
-
void setup() {
124
+
void setup()
125
+
{
130
126
Serial.begin(115200);
131
127
delay(1000);
132
128
mySerial.begin(9600);
@@ -135,7 +131,8 @@ void setup() {
135
131
}
136
132
137
133
138
-
void loop() {
134
+
void loop()
135
+
{
139
136
140
137
// The dust sensor sends its data continuously, so let's catch that data.
0 commit comments