Skip to content

Commit

Permalink
ESP32 : Fixing the sensor identification bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaneam committed Mar 21, 2021
1 parent 7173b0b commit 74e891e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ESP32/lib/SSD1306/OLEDExtended.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void OLEDDisplayExtended::ShowMSummary(float average, float min, float max, Disp
break;
case DisplayStatus::AirQualitySensor:
this->drawXbm(sensor_icon_pos[0], sensor_icon_pos[1], sensor_icon_pos[2], sensor_icon_pos[3], Air_Quality_Sensor_icon_img);
this->drawString(Sensor_Text_Area[0], Sensor_Text_Area[1], String(average, 0));
this->drawString(Sensor_Text_Area[0], Sensor_Text_Area[1], String(average, 1));
this->drawString(Sensor_Text_Area[0] + 42, Sensor_Text_Area[1], String(min, 0));
this->drawString(Sensor_Text_Area[0] + 84, Sensor_Text_Area[1], String(max, 0));
break;
Expand Down
2 changes: 1 addition & 1 deletion ESP32/lib/Sensor/EnvironmentSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ bool EnvironmentSensor::Initialize(TwoWire &i2c)
if (bmx280.begin(BME280_ADDRESS, &i2c))
{
initializeBMx280();
sensorType = bmx280.isBME280 ? SensorType::BME680_Sensor : SensorType::BMP280_Sensor;
sensorType = bmx280.isBME280 ? SensorType::BME280_Sensor : SensorType::BMP280_Sensor;
return true;
}
sensorType = SensorType::No_Sensor;
Expand Down
8 changes: 4 additions & 4 deletions ESP32/src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

#define SENSOR_SDA_PIN 5
#define SENSOR_SCL_PIN 4
#define OLED_SDA_PIN 21
#define OLED_SCL_PIN 22
#define OLED_SDA_PIN 21 // 5 // 21
#define OLED_SCL_PIN 22 // 4 // 22
#define SDA_Frequency 400000
#define OLED_Address 0x3c

#define BLE_ADVERTISE_TIMEOUT_S 60 // BLE advertising timeout
#define BLE_ADVERTISE_ENABLE_PIN 33 //02 // 12 //
#define BLE_ADVERTISE_ENABLE_PIN 15 //02 // 33 // 15
#define BLE_ADVERTISE_LED_PIN 12
#define SENSOR_READ_INTERVAL 60

#define EEPROM_SIZE 256
#define SERIAL_BAUDRATE 115200

#define VERBOSE true
#define VERBOSE false

0 comments on commit 74e891e

Please sign in to comment.