Skip to content

Commit 6ae6437

Browse files
committed
Added .gitignore file to ignore backup files
Updated MySensorsMicro sketch with comments, and rearranged code a little
1 parent ec37c4d commit 6ae6437

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*~
2+
*bak

libraries/MySensors/examples/MysensorMicro/MysensorMicro.ino

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@
2323
#define CHILD_ID_HUM 2
2424
#define CHILD_ID_BATT 199
2525

26+
// How many milli seconds between each measurement
27+
#define MEASURE_INTERVAL 60000
28+
29+
// FORCE_TRANSMIT_INTERVAL, this number of times of wakeup, the sensor is forced to report all values to the controller
30+
#define FORCE_TRANSMIT_INTERVAL 30
31+
32+
// When MEASURE_INTERVAL is 60000 and FORCE_TRANSMIT_INTERVAL is 30, we force a transmission every 30 minutes.
33+
// Between the forced transmissions a tranmission will only occur if the measured value differs from the previous measurement
34+
2635
//Pin definitions
2736
#define TEST_PIN A0
2837
#define LED_PIN A2
@@ -31,12 +40,6 @@
3140
const int sha204Pin = ATSHA204_PIN;
3241
atsha204Class sha204(sha204Pin);
3342

34-
35-
#define MEASURE_INTERVAL 60000
36-
37-
// FORCE_TRANSMIT_INTERVAL, this number of times of wakeup, the sensor is forced to report all values to the controller
38-
#define FORCE_TRANSMIT_INTERVAL 30
39-
4043
SI7021 humiditySensor;
4144
SPIFlash flash(8, 0x1F65);
4245

@@ -97,7 +100,7 @@ void loop() {
97100
bool forceTransmit = false;
98101

99102
if (measureCount > FORCE_TRANSMIT_INTERVAL
100-
) {// Every 60th time we wake up, force a transmission on all sensors.
103+
) { // force a transmission
101104
forceTransmit = true;
102105
measureCount = 0;
103106
}

0 commit comments

Comments
 (0)