Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 #include "BME280.h" 00003 00004 Serial pc(USBTX, USBRX); 00005 00006 #if defined(TARGET_LPC1768) 00007 BME280 sensor(p28, p27); 00008 #elif defined(TARGET_TY51822R3) 00009 BME280 sensor(P0_30, P0_7); 00010 #else 00011 BME280 sensor(SDA, SCL); 00012 #endif 00013 00014 int main() { 00015 00016 while(1) { 00017 pc.printf("%2.2f degC, %04.2f hPa, %2.2f %%\n", sensor.getTemperature(), sensor.getPressure(), sensor.getHumidity()); 00018 wait(1); 00019 } 00020 }
Generated on Wed Jul 13 2022 10:35:28 by
1.7.2
BME280 Combined humidity and pressure sensor