hakim belm / Mbed 2 deprecated BME280

Dependencies:   BME280 mbed

Committer:
titanium
Date:
Tue Feb 16 06:43:26 2021 +0000
Revision:
5:a28271106113
Parent:
4:5656d9c63801
Child:
6:84b3ef333908
imported from BME280-Hello

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MACRUM 0:2c9585cecfde 1 #include "mbed.h"
MACRUM 0:2c9585cecfde 2 #include "BME280.h"
MACRUM 0:2c9585cecfde 3
MACRUM 0:2c9585cecfde 4 Serial pc(USBTX, USBRX);
MACRUM 0:2c9585cecfde 5
MACRUM 0:2c9585cecfde 6 #if defined(TARGET_LPC1768)
MACRUM 0:2c9585cecfde 7 BME280 sensor(p28, p27);
MACRUM 4:5656d9c63801 8 #elif defined(TARGET_TY51822R3)
MACRUM 4:5656d9c63801 9 BME280 sensor(P0_30, P0_7);
MACRUM 0:2c9585cecfde 10 #else
MACRUM 4:5656d9c63801 11 BME280 sensor(SDA, SCL);
MACRUM 0:2c9585cecfde 12 #endif
MACRUM 0:2c9585cecfde 13
MACRUM 0:2c9585cecfde 14 int main() {
MACRUM 0:2c9585cecfde 15
MACRUM 0:2c9585cecfde 16 while(1) {
titanium 5:a28271106113 17 pc.printf("%2.1f degC %04.1f hPa %2.1f%%\r\n", sensor.getTemperature(), sensor.getPressure(), sensor.getHumidity());
titanium 5:a28271106113 18 wait(3);
MACRUM 0:2c9585cecfde 19 }
MACRUM 0:2c9585cecfde 20 }