Skip to content

Commit

Permalink
SensorBosch - fixed forecast propagation and i2c address detection (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
lejn authored and user2684 committed Mar 15, 2018
1 parent fd09d66 commit 2aa7466
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion NodeManagerLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ class SensorBosch: public Sensor {
void setForecastSamplesCount(int value);
// define what to do at each stage of the sketch
void onReceive(MyMessage* message);
static uint8_t GetI2CAddress(uint8_t chip_id);
uint8_t GetI2CAddress(uint8_t chip_id);
protected:
char* _weather[6] = { "stable", "sunny", "cloudy", "unstable", "thunderstorm", "unknown" };
int _forecast_samples_count = 5;
Expand Down
8 changes: 4 additions & 4 deletions NodeManagerLibrary.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,7 @@ float SensorBosch::_getLastPressureSamplesAverage() {
uint8_t SensorBosch::GetI2CAddress(uint8_t chip_id) {
uint8_t addresses[] = {0x77, 0x76};
uint8_t register_address = 0xD0;
for (int i = 0; i <= sizeof(addresses); i++) {
for (int i = 0; i < sizeof(addresses); i++) {
uint8_t i2c_address = addresses[i];
uint8_t value;
Wire.beginTransmission((uint8_t)i2c_address);
Expand Down Expand Up @@ -2065,7 +2065,7 @@ void SensorBME280::onLoop(Child* child) {
// Forecast Sensor
else if (child->type == V_FORECAST) {
float pressure = _bm->readPressure() / 100.0F;
_forecast(pressure);
((ChildString*)child)->setValueString(_forecast(pressure));
}
}
#endif
Expand Down Expand Up @@ -2128,7 +2128,7 @@ void SensorBMP085::onLoop(Child* child) {
// Forecast Sensor
else if (child->type == V_FORECAST) {
float pressure = _bm->readPressure() / 100.0F;
_forecast(pressure);
((ChildString*)child)->setValueString(_forecast(pressure));
}
}
#endif
Expand Down Expand Up @@ -2190,7 +2190,7 @@ void SensorBMP280::onLoop(Child* child) {
// Forecast Sensor
else if (child->type == V_FORECAST) {
float pressure = _bm->readPressure() / 100.0F;
_forecast(pressure);
((ChildString*)child)->setValueString(_forecast(pressure));
}
}
#endif
Expand Down

0 comments on commit 2aa7466

Please sign in to comment.