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,5 +1,4 @@
|
||||
#include <SPI.h>
|
||||
#include <RF24.h>
|
||||
#include <MySensor.h>
|
||||
#include <Wire.h>
|
||||
#include <Adafruit_BMP085.h>
|
||||
@@ -8,7 +7,7 @@
|
||||
#define TEMP_CHILD 1
|
||||
|
||||
#define LIGHT_SENSOR_ANALOG_PIN 0
|
||||
unsigned long SLEEP_TIME = 60; // Sleep time between reads (in seconds)
|
||||
unsigned long SLEEP_TIME = 60000; // Sleep time between reads (in seconds)
|
||||
|
||||
Adafruit_BMP085 bmp = Adafruit_BMP085(); // Digital Pressure Sensor
|
||||
MySensor gw;
|
||||
@@ -28,8 +27,6 @@ MyMessage tempMsg(TEMP_CHILD, V_TEMP);
|
||||
MyMessage pressureMsg(BARO_CHILD, V_PRESSURE);
|
||||
MyMessage forecastMsg(BARO_CHILD, V_FORECAST);
|
||||
|
||||
|
||||
|
||||
void setup() {
|
||||
gw.begin();
|
||||
|
||||
@@ -47,7 +44,6 @@ void setup() {
|
||||
metric = gw.getConfig().isMetric;
|
||||
}
|
||||
|
||||
|
||||
void loop() {
|
||||
float pressure = bmp.readPressure();
|
||||
float temperature = bmp.readTemperature();
|
||||
@@ -94,8 +90,7 @@ void loop() {
|
||||
5 = "Unknown (More Time needed)
|
||||
*/
|
||||
|
||||
delay(300); //delay to allow serial to fully print before sleep
|
||||
gw.sleep(SLEEP_TIME * 1000);
|
||||
gw.sleep(SLEEP_TIME);
|
||||
}
|
||||
|
||||
int sample(float pressure) {
|
||||
|
||||
Reference in New Issue
Block a user