Hello program for BME280 library adapted to L073
Fork of BME280_Hello by
main.cpp@4:ccbe1195df4b, 2016-07-25 (annotated)
- Committer:
- jcaridadhdez
- Date:
- Mon Jul 25 09:59:01 2016 +0000
- Revision:
- 4:ccbe1195df4b
- Parent:
- 0:2c9585cecfde
L073 adapted
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 | BME280 sensor(I2C_SDA, I2C_SCL); |
MACRUM | 0:2c9585cecfde | 6 | |
MACRUM | 0:2c9585cecfde | 7 | int main() { |
MACRUM | 0:2c9585cecfde | 8 | |
MACRUM | 0:2c9585cecfde | 9 | while(1) { |
MACRUM | 0:2c9585cecfde | 10 | pc.printf("%2.2f degC, %04.2f hPa, %2.2f %%\n", sensor.getTemperature(), sensor.getPressure(), sensor.getHumidity()); |
MACRUM | 0:2c9585cecfde | 11 | wait(1); |
MACRUM | 0:2c9585cecfde | 12 | } |
MACRUM | 0:2c9585cecfde | 13 | } |