Skip to content

Commit 46a74b2

Browse files
committed
v1.7 pre-release tests
1 parent cb7797c commit 46a74b2

File tree

4 files changed

+135
-97
lines changed

4 files changed

+135
-97
lines changed

NodeManager.ino

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ SensorDs18b20 | 1+ | USE_DS18B20 | DS18B20 sensor, return t
7070
SensorBH1750 | 1 | USE_BH1750 | BH1750 sensor, return light level in lux | https://github.com/claws/BH1750
7171
SensorMLX90614 | 2 | USE_MLX90614 | MLX90614 contactless temperature sensor, return ambient and object temperature | https://github.com/adafruit/Adafruit-MLX90614-Library
7272
SensorBME280 | 4 | USE_BME280 | BME280 sensor, return temperature/humidity/pressure based on the attached BME280 sensor | https://github.com/adafruit/Adafruit_BME280_Library
73-
SensorBMP085 | 3 | USE_BMP085 | BMP085/BMP180 sensor, return temperature and pressure | https://github.com/adafruit/Adafruit-BMP085-Library
73+
SensorBMP085 | 3 | USE_BMP085_180 | BMP085 sensor, return temperature and pressure | https://github.com/adafruit/Adafruit-BMP085-Library
74+
SensorBMP180 | 3 | USE_BMP085_180 | BMP180 sensor, return temperature and pressure | https://github.com/adafruit/Adafruit-BMP085-Library
7475
SensorBMP280 | 3 | USE_BMP280 | BMP280 sensor, return temperature/pressure based on the attached BMP280 sensor | https://github.com/adafruit/Adafruit_BMP280_Library
7576
SensorSonoff | 1 | USE_SONOFF | Sonoff wireless smart switch | https://github.com/thomasfredericks/Bounce2
7677
SensorHCSR04 | 1 | USE_HCSR04 | HC-SR04 sensor, return the distance between the sensor and an object | https://github.com/mysensors/MySensorsArduinoExamples/tree/master/libraries/NewPing
@@ -119,6 +120,7 @@ FEATURE_TIME | OFF | allow keeping the current system time in
119120
FEATURE_RTC | OFF | allow keeping the current system time in sync with an attached RTC device (requires FEATURE_TIME)| https://github.com/JChristensen/DS3232RTC
120121
FEATURE_SD | OFF | allow reading from and writing to SD cards | -
121122
FEATURE_HOOKING | OFF | allow custom code to be hooked in the out of the box sensors | -
123+
**/
122124

123125
/**********************************
124126
* MySensors node configuration
@@ -262,7 +264,7 @@ FEATURE_HOOKING | OFF | allow custom code to be hooked in the ou
262264
//#define USE_BH1750
263265
//#define USE_MLX90614
264266
//#define USE_BME280
265-
//#define USE_BMP085
267+
//#define USE_BMP085_180
266268
//#define USE_BMP280
267269
//#define USE_SONOFF
268270
//#define USE_HCSR04
@@ -345,6 +347,7 @@ NodeManager node;
345347
//SensorMLX90614 mlx90614(node);
346348
//SensorBME280 bme280(node);
347349
//SensorBMP085 bmp085(node);
350+
//SensorBMP180 bmp180(node);
348351
//SensorBMP280 bmp280(node);
349352
//SensorSonoff sonoff(node);
350353
//SensorHCSR04 hcsr04(node,6);
@@ -385,6 +388,8 @@ void before() {
385388
//node.setReportIntervalSeconds(10);
386389
// report measures of every attached sensors every 10 minutes
387390
//node.setReportIntervalMinutes(10);
391+
// set the node to sleep in 30 seconds cycles
392+
//node.setSleepSeconds(30);
388393
// set the node to sleep in 5 minutes cycles
389394
//node.setSleepMinutes(5);
390395
// report battery level every 10 minutes

NodeManagerLibrary.h

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
#ifdef USE_SONOFF
178178
#include <Bounce2.h>
179179
#endif
180-
#ifdef USE_BMP085
180+
#ifdef USE_BMP085_180
181181
#include <Wire.h>
182182
#include <Adafruit_BMP085.h>
183183
#endif
@@ -319,7 +319,7 @@ template<typename T> class List {
319319
inline iterator begin() { return _internalArray; }
320320
inline iterator end() { return _internalArray + _endPosition; }
321321
inline bool empty() { return (_endPosition == 0); }
322-
inline unsigned int size() { return _endPosition; }
322+
inline int size() { return _endPosition; }
323323
void allocateBlocks(int alloc) {
324324
_allocBlocks = alloc;
325325
T* newArray = new T[_allocBlocks];
@@ -1110,17 +1110,17 @@ class SensorMLX90614: public Sensor {
11101110
* SensorBosch
11111111
*/
11121112

1113-
#if defined(USE_BME280) || defined(USE_BMP085) || defined(USE_BMP280)
1113+
#if defined(USE_BME280) || defined(USE_BMP085_180) || defined(USE_BMP280)
11141114
class SensorBosch: public Sensor {
11151115
public:
11161116
SensorBosch(NodeManager& node_manager, int child_id = -255);
11171117
// [101] define how many pressure samples to keep track of for calculating the forecast (default: 5)
11181118
void setForecastSamplesCount(int value);
11191119
// define what to do at each stage of the sketch
11201120
void onReceive(MyMessage* message);
1121-
uint8_t GetI2CAddress(uint8_t chip_id);
1121+
uint8_t detectI2CAddress(uint8_t chip_id);
11221122
protected:
1123-
char* _weather[6] = { "stable", "sunny", "cloudy", "unstable", "thunderstorm", "unknown" };
1123+
const char* _weather[6] = { "stable", "sunny", "cloudy", "unstable", "thunderstorm", "unknown" };
11241124
int _forecast_samples_count = 5;
11251125
float* _forecast_samples;
11261126
int _minute_count = 0;
@@ -1129,7 +1129,7 @@ class SensorBosch: public Sensor {
11291129
float _dP_dt;
11301130
bool _first_round = true;
11311131
float _getLastPressureSamplesAverage();
1132-
char* _forecast(float pressure);
1132+
const char* _forecast(float pressure);
11331133
};
11341134
#endif
11351135

@@ -1151,7 +1151,7 @@ class SensorBME280: public SensorBosch {
11511151
/*
11521152
SensorBMP085
11531153
*/
1154-
#ifdef USE_BMP085
1154+
#ifdef USE_BMP085_180
11551155
class SensorBMP085: public SensorBosch {
11561156
public:
11571157
SensorBMP085(NodeManager& node_manager, int child_id = -255);
@@ -1161,6 +1161,14 @@ class SensorBMP085: public SensorBosch {
11611161
protected:
11621162
Adafruit_BMP085* _bm;
11631163
};
1164+
1165+
/*
1166+
SensorBMP180
1167+
*/
1168+
class SensorBMP180: public SensorBMP085 {
1169+
public:
1170+
SensorBMP180(NodeManager& node_manager, int child_id = -255);
1171+
};
11641172
#endif
11651173

11661174
/*
@@ -1617,7 +1625,7 @@ class DisplaySSD1306: public Display {
16171625
uint8_t _i2caddress = 0x3c;
16181626
int _fontsize = 1;
16191627
int _caption_fontsize = 2;
1620-
uint8_t* _font = Adafruit5x7;
1628+
const uint8_t* _font = Adafruit5x7;
16211629
uint8_t _contrast = -1;
16221630
};
16231631
#endif

0 commit comments

Comments
 (0)