Skip to content

Commit

Permalink
debug update
Browse files Browse the repository at this point in the history
  • Loading branch information
pilotak committed May 25, 2021
1 parent efd54d5 commit 2e3d0c2
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 26 deletions.
4 changes: 2 additions & 2 deletions code/WemosWeatherStation/sensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ void sensorsLoop() {
#if defined(HAS_BARO)
Serial.print("[SENSOR] Pressure: ");
Serial.print(data.pressure[1], 2);
Serial.print("hPa (abs), ");
Serial.print(" hPa (abs), ");
Serial.print(data.pressure[0], 2);
Serial.println("hPa (rel)");
Serial.println(" hPa (rel)");
Serial.print("[SENSOR] Pressure temp: ");
Serial.print(data.temp[0]);
Serial.println(" C");
Expand Down
8 changes: 4 additions & 4 deletions code/WemosWeatherStation/sensors/bmp280.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ bool setupBaro() {
if (bmp.begin()) {
sensor_state |= (1 << 0);

#if defined(DEBUG)
Serial.println("[SENSOR] Baro is online");
#endif
return true;
}

#if defined(DEBUG)

if (sensor_state & 0b1) {
Serial.println("[SENSOR] BMP280 did not respond. Please check wiring.");
}
Serial.println("[SENSOR] Baro did not respond. Please check wiring.");

#endif

Expand Down
9 changes: 4 additions & 5 deletions code/WemosWeatherStation/sensors/htu21d.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ bool setupHumidity() {
if (htu.begin(SDA, SCL)) {
sensor_state |= (1 << 2);

#if defined(DEBUG)
Serial.println("[SENSOR] HTU21D is online");
#endif
return true;
}

#if defined(DEBUG)

if (sensor_state & 0b100) {
Serial.println("[SENSOR] HTU21D did not respond. Please check wiring.");
}

Serial.println("[SENSOR] HTU21D did not respond. Please check wiring.");
#endif

sensor_state &= ~(1 << 2);
Expand Down
9 changes: 4 additions & 5 deletions code/WemosWeatherStation/sensors/lps35hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ bool setupBaro() {
lps.setLowPassFilter(LPS35HW::LowPassFilter_ODR9);
sensor_state |= (1 << 0);

#if defined(DEBUG)
Serial.println("[SENSOR] LPS35HW is online");
#endif
return true;
}

#if defined(DEBUG)

if (sensor_state & 0b1) {
Serial.println("[SENSOR] LPS35HW did not respond. Please check wiring.");
}

Serial.println("[SENSOR] LPS35HW did not respond. Please check wiring.");
#endif

sensor_state &= ~(1 << 0);
Expand Down
9 changes: 4 additions & 5 deletions code/WemosWeatherStation/sensors/mcp9808.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ bool setupTemp() {
mcp.setResolution(3);
mcp.shutdown_wake(0);

#if defined(DEBUG)
Serial.println("[SENSOR] MCP9808 is online");
#endif
return true;
}

#if defined(DEBUG)

if (sensor_state & 0b10) {
Serial.println("[SENSOR] MCP9808 did not respond. Please check wiring.");
}

Serial.println("[SENSOR] MCP9808 did not respond. Please check wiring.");
#endif

sensor_state &= ~(1 << 1);
Expand Down
9 changes: 4 additions & 5 deletions code/WemosWeatherStation/sensors/sht31d.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ bool setupHumidity() {
if (sht31.periodicStart(SHT3XD_REPEATABILITY_HIGH, SHT3XD_FREQUENCY_10HZ) == SHT3XD_NO_ERROR) {
sensor_state |= (1 << 2);

#if defined(DEBUG)
Serial.println("[SENSOR] SHT31D is online");
#endif
return true;
}
}

#if defined(DEBUG)

if (sensor_state & 0b100) {
Serial.println("[SENSOR] SHT31D did not respond. Please check wiring.");
}

Serial.println("[SENSOR] SHT31D did not respond. Please check wiring.");
#endif

sensor_state &= ~(1 << 2);
Expand Down

0 comments on commit 2e3d0c2

Please sign in to comment.