Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Trouble compiling Wireless Display Software
#7

Hi,

You could test your BME280 installed on the Wireless Display unit using this little code (it uses the same library used on the Wireless Display software):


Code:
#include <BME280I2C.h> #include <Wire.h> #define SERIAL_BAUD 115200 BME280I2C bme; // Default : forced mode, standby time = 1000 ms // Oversampling = pressure ×1, temperature ×1, humidity ×1, filter off, ////////////////////////////////////////////////////////////////// void setup() { Serial.begin(SERIAL_BAUD); while(!Serial) {} // Wait Wire.begin(); while(!bme.begin()) { Serial.println("Could not find BME280 sensor!"); delay(1000); } switch(bme.chipModel()) { case BME280::ChipModel_BME280: Serial.println("Found BME280 sensor! Success."); break; case BME280::ChipModel_BMP280: Serial.println("Found BMP280 sensor! No Humidity available."); break; default: Serial.println("Found UNKNOWN sensor! Error!"); } } ////////////////////////////////////////////////////////////////// void loop() { printBME280Data(&Serial); delay(500); } ////////////////////////////////////////////////////////////////// void printBME280Data ( Stream* client ) { float temp(NAN), hum(NAN), pres(NAN); BME280::TempUnit tempUnit(BME280::TempUnit_Celsius); BME280::PresUnit presUnit(BME280::PresUnit_Pa); bme.read(pres, temp, hum, tempUnit, presUnit); client->print("Temp: "); client->print(temp); client->print("°"+ String(tempUnit == BME280::TempUnit_Celsius ? 'C' :'F')); client->print("\t\tHumidity: "); client->print(hum); client->print("% RH"); client->print("\t\tPressure: "); client->print(pres); client->println("Pa"); delay(1000); }
Reply


Messages In This Thread
Trouble compiling Wireless Display Software - by coupe pete - 19-01-2023, 12:41
RE: Trouble compiling Wireless Display Software - by hornychz - 19-01-2023, 16:08
RE: Trouble compiling Wireless Display Software - by werk_ag - 19-01-2023, 16:25
RE: Trouble compiling Wireless Display Software - by coupe pete - 20-01-2023, 23:49
RE: Trouble compiling Wireless Display Software - by hornychz - 21-01-2023, 16:33
RE: Trouble compiling Wireless Display Software - by coupe pete - 28-01-2023, 06:00
RE: Trouble compiling Wireless Display Software - by werk_ag - 30-01-2023, 03:05
RE: Trouble compiling Wireless Display Software - by coupe pete - 30-01-2023, 12:37



Users browsing this thread: 1 Guest(s)