From 6ae64373f9ee2dd65ee7fa6b22b89716cf4f6d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=B8rch?= Date: Sun, 29 Mar 2015 11:29:47 +0200 Subject: [PATCH 1/2] Added .gitignore file to ignore backup files Updated MySensorsMicro sketch with comments, and rearranged code a little --- .gitignore | 2 ++ .../examples/MysensorMicro/MysensorMicro.ino | 17 ++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 .gitignore 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; } From 0c057e82e24cad75c15e43cc69fb8ada0e07dd9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=B8rch?= Date: Tue, 31 Mar 2015 10:53:17 +0200 Subject: [PATCH 2/2] Corrected fuse settings for the micro board --- hardware/MySensors/avr/boards.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hardware/MySensors/avr/boards.txt b/hardware/MySensors/avr/boards.txt index 75e1e53..a603989 100644 --- a/hardware/MySensors/avr/boards.txt +++ b/hardware/MySensors/avr/boards.txt @@ -10,9 +10,9 @@ MysensorsMicro.upload.speed=57600 MysensorsMicro.bootloader.tool=arduino:avrdude MysensorsMicro.bootloader.unlock_bits=0x3F MysensorsMicro.bootloader.lock_bits=0x0F -MysensorsMicro.bootloader.low_fuses=0xFF -MysensorsMicro.bootloader.high_fuses=0xDA -MysensorsMicro.bootloader.extended_fuses=0x05 +MysensorsMicro.bootloader.low_fuses=0xE2 +MysensorsMicro.bootloader.high_fuses=0xD2 +MysensorsMicro.bootloader.extended_fuses=0xFE MysensorsMicro.bootloader.file=DualOptiboot/optiboot_atmega328p-pro8.hex MysensorsMicro.build.board=AVR_MICRO8