hakim belm / Mbed 2 deprecated BME280

Dependencies:   BME280 mbed

Files at this revision

API Documentation at this revision

Comitter:
hakim_belm
Date:
Sat Sep 10 09:20:16 2022 +0000
Parent:
5:a28271106113
Commit message:
librairie BME280 corrigee

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Feb 16 06:43:26 2021 +0000
+++ b/main.cpp	Sat Sep 10 09:20:16 2022 +0000
@@ -3,16 +3,12 @@
 
 Serial pc(USBTX, USBRX);
 
-#if defined(TARGET_LPC1768)
-BME280 sensor(p28, p27);
-#elif defined(TARGET_TY51822R3)
-BME280 sensor(P0_30, P0_7);
-#else
-BME280 sensor(SDA, SCL);
-#endif
+
+BME280 sensor(I2C_SDA, I2C_SCL,0x77);
+
 
 int main() {
-    
+    sensor.initialize();
     while(1) {
         pc.printf("%2.1f degC   %04.1f hPa   %2.1f%%\r\n", sensor.getTemperature(), sensor.getPressure(), sensor.getHumidity());
         wait(3);