diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bfc784e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +*bak \ No newline at end of file diff --git a/libraries/MySensors/examples/MysensorMicro/MysensorMicro.ino b/libraries/MySensors/examples/MysensorMicro/MysensorMicro.ino index 2d70c41..c25fac2 100644 --- a/libraries/MySensors/examples/MysensorMicro/MysensorMicro.ino +++ b/libraries/MySensors/examples/MysensorMicro/MysensorMicro.ino @@ -23,6 +23,15 @@ #define CHILD_ID_HUM 2 #define CHILD_ID_BATT 199 +// How many milli seconds between each measurement +#define MEASURE_INTERVAL 60000 + +// FORCE_TRANSMIT_INTERVAL, this number of times of wakeup, the sensor is forced to report all values to the controller +#define FORCE_TRANSMIT_INTERVAL 30 + +// When MEASURE_INTERVAL is 60000 and FORCE_TRANSMIT_INTERVAL is 30, we force a transmission every 30 minutes. +// Between the forced transmissions a tranmission will only occur if the measured value differs from the previous measurement + //Pin definitions #define TEST_PIN A0 #define LED_PIN A2 @@ -31,12 +40,6 @@ const int sha204Pin = ATSHA204_PIN; atsha204Class sha204(sha204Pin); - -#define MEASURE_INTERVAL 60000 - -// FORCE_TRANSMIT_INTERVAL, this number of times of wakeup, the sensor is forced to report all values to the controller -#define FORCE_TRANSMIT_INTERVAL 30 - SI7021 humiditySensor; SPIFlash flash(8, 0x1F65); @@ -97,7 +100,7 @@ void loop() { bool forceTransmit = false; if (measureCount > FORCE_TRANSMIT_INTERVAL - ) {// Every 60th time we wake up, force a transmission on all sensors. + ) { // force a transmission forceTransmit = true; measureCount = 0; }