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@6:84b3ef333908, 2022-09-10 (annotated)
- Committer:
- hakim_belm
- Date:
- Sat Sep 10 09:20:16 2022 +0000
- Revision:
- 6:84b3ef333908
- Parent:
- 5:a28271106113
librairie BME280 corrigee
Who changed what in which revision?
User | Revision | Line number | New 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 | |
hakim_belm | 6:84b3ef333908 | 6 | |
hakim_belm | 6:84b3ef333908 | 7 | BME280 sensor(I2C_SDA, I2C_SCL,0x77); |
hakim_belm | 6:84b3ef333908 | 8 | |
MACRUM | 0:2c9585cecfde | 9 | |
MACRUM | 0:2c9585cecfde | 10 | int main() { |
hakim_belm | 6:84b3ef333908 | 11 | sensor.initialize(); |
MACRUM | 0:2c9585cecfde | 12 | while(1) { |
titanium | 5:a28271106113 | 13 | pc.printf("%2.1f degC %04.1f hPa %2.1f%%\r\n", sensor.getTemperature(), sensor.getPressure(), sensor.getHumidity()); |
titanium | 5:a28271106113 | 14 | wait(3); |
MACRUM | 0:2c9585cecfde | 15 | } |
MACRUM | 0:2c9585cecfde | 16 | } |