RF24 moved to utility folder of library. This results in one less include in sketches!
Serial flush in sleep method also means one less code in examples. Removed set(bool) in message. Not needed. getBool just calls getInt __attribute__((packed)) for RPI compability Print more info in send/read debug prints. Get internalTemp returns full degrees and uses longer Vref delay Fix debug print gateway prepend (wrong command/type) Fixed problem in RelayWithButton example. Now working with ack in both directions. Serial protocol changed (incoming serial message have an new ack-parameter)
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
#include <SPI.h>
|
||||
#include <RF24.h>
|
||||
#include <MySensor.h>
|
||||
|
||||
#define CHILD_ID_LIGHT 0
|
||||
#define LIGHT_SENSOR_ANALOG_PIN 0
|
||||
|
||||
unsigned long SLEEP_TIME = 30; // Sleep time between reads (in seconds)
|
||||
unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
|
||||
|
||||
MySensor gw;
|
||||
MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
|
||||
@@ -30,9 +29,7 @@ void loop()
|
||||
gw.send(msg.set(lightLevel));
|
||||
lastLightLevel = lightLevel;
|
||||
}
|
||||
|
||||
delay(300); //delay to allow serial to fully print before sleep
|
||||
gw.sleep(SLEEP_TIME * 1000);
|
||||
gw.sleep(SLEEP_TIME);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user