File tree Expand file tree Collapse file tree 4 files changed +33
-3
lines changed
Expand file tree Collapse file tree 4 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -14,4 +14,7 @@ begin KEYWORD2
1414refresh KEYWORD2
1515readPM25 KEYWORD2
1616readPM10 KEYWORD2
17- readPM01 KEYWORD2
17+ readPM01 KEYWORD2
18+ enablePowerControl KEYWORD2
19+ turnOn KEYWORD2
20+ turnOff KEYWORD2
Original file line number Diff line number Diff line change 11name =hackAIR
2- version =0.3.4
2+ version =0.4.0
33author =Thanasis Georgiou <
[email protected] >
44maintainer =Thanasis Georgiou <
[email protected] >
55sentence =A library for using a variety of air quality sensors.
Original file line number Diff line number Diff line change @@ -141,3 +141,15 @@ void hackAIR::clearData(hackAirData &data) {
141141 data.tamper = 0 ;
142142 data.battery = 0 ;
143143}
144+
145+ void enablePowerControl () {
146+ pinMode (A2, OUTPUT);
147+ }
148+
149+ void turnOn () {
150+ digitalWrite (A2, HIGH);
151+ }
152+
153+ void turnOff () {
154+ digitalWrite (A2, LOW);
155+ }
Original file line number Diff line number Diff line change @@ -64,12 +64,27 @@ class hackAIR {
6464 * sensors.
6565 */
6666 void refresh (hackAirData &data);
67-
67+
6868 /* *
6969 * Empties a hackAir data structure
7070 */
7171 void clearData (hackAirData &data);
7272
73+ /* *
74+ * Uses pin A2 to control the sensor power switch (FET)
75+ */
76+ void enablePowerControl ();
77+
78+ /* *
79+ * Turn the sensor power on
80+ */
81+ void turnOn ();
82+
83+ /* *
84+ * Turn the sensor power off
85+ */
86+ void turnOff ();
87+
7388private:
7489 int _sensorType;
7590 long _lastTime;
You can’t perform that action at this time.
0 commit comments