Skip to content

Commit 264b790

Browse files
lejnuser2684
authored andcommitted
SensorBosch - fixed forecast propagation and i2c address detection (#326)
1 parent ff0b21f commit 264b790

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

NodeManagerLibrary.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ class SensorBosch: public Sensor {
10981098
void setForecastSamplesCount(int value);
10991099
// define what to do at each stage of the sketch
11001100
void onReceive(MyMessage* message);
1101-
static uint8_t GetI2CAddress(uint8_t chip_id);
1101+
uint8_t GetI2CAddress(uint8_t chip_id);
11021102
protected:
11031103
char* _weather[6] = { "stable", "sunny", "cloudy", "unstable", "thunderstorm", "unknown" };
11041104
int _forecast_samples_count = 5;

NodeManagerLibrary.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,7 @@ float SensorBosch::_getLastPressureSamplesAverage() {
19741974
uint8_t SensorBosch::GetI2CAddress(uint8_t chip_id) {
19751975
uint8_t addresses[] = {0x77, 0x76};
19761976
uint8_t register_address = 0xD0;
1977-
for (int i = 0; i <= sizeof(addresses); i++) {
1977+
for (int i = 0; i < sizeof(addresses); i++) {
19781978
uint8_t i2c_address = addresses[i];
19791979
uint8_t value;
19801980
Wire.beginTransmission((uint8_t)i2c_address);
@@ -2065,7 +2065,7 @@ void SensorBME280::onLoop(Child* child) {
20652065
// Forecast Sensor
20662066
else if (child->type == V_FORECAST) {
20672067
float pressure = _bm->readPressure() / 100.0F;
2068-
_forecast(pressure);
2068+
((ChildString*)child)->setValueString(_forecast(pressure));
20692069
}
20702070
}
20712071
#endif
@@ -2128,7 +2128,7 @@ void SensorBMP085::onLoop(Child* child) {
21282128
// Forecast Sensor
21292129
else if (child->type == V_FORECAST) {
21302130
float pressure = _bm->readPressure() / 100.0F;
2131-
_forecast(pressure);
2131+
((ChildString*)child)->setValueString(_forecast(pressure));
21322132
}
21332133
}
21342134
#endif
@@ -2190,7 +2190,7 @@ void SensorBMP280::onLoop(Child* child) {
21902190
// Forecast Sensor
21912191
else if (child->type == V_FORECAST) {
21922192
float pressure = _bm->readPressure() / 100.0F;
2193-
_forecast(pressure);
2193+
((ChildString*)child)->setValueString(_forecast(pressure));
21942194
}
21952195
}
21962196
#endif

0 commit comments

Comments
 (0)