Josef Humer
/
BuNuc_BME280_C02
Hello program for BME280 library
main.cpp@4:07413c4d0b80, 2020-01-08 (annotated)
- Committer:
- heseg
- Date:
- Wed Jan 08 16:05:58 2020 +0000
- Revision:
- 4:07413c4d0b80
- Parent:
- 0:2c9585cecfde
NUCLEO-F303K8, BME280, Hello, simple
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
heseg | 4:07413c4d0b80 | 1 | /* ********************************************************** */ |
heseg | 4:07413c4d0b80 | 2 | /* *************** Projekt: BuNuc_BME280_C02 **************** */ |
heseg | 4:07413c4d0b80 | 3 | /* BULME Graz, Abteilung Elektronik und Technische Informatik */ |
heseg | 4:07413c4d0b80 | 4 | /* ********************************************************** */ |
MACRUM | 0:2c9585cecfde | 5 | #include "mbed.h" |
MACRUM | 0:2c9585cecfde | 6 | #include "BME280.h" |
MACRUM | 0:2c9585cecfde | 7 | |
MACRUM | 0:2c9585cecfde | 8 | Serial pc(USBTX, USBRX); |
MACRUM | 0:2c9585cecfde | 9 | |
MACRUM | 0:2c9585cecfde | 10 | BME280 sensor(I2C_SDA, I2C_SCL); |
MACRUM | 0:2c9585cecfde | 11 | |
heseg | 4:07413c4d0b80 | 12 | int main() |
heseg | 4:07413c4d0b80 | 13 | { |
MACRUM | 0:2c9585cecfde | 14 | |
heseg | 4:07413c4d0b80 | 15 | while(1) |
heseg | 4:07413c4d0b80 | 16 | { |
MACRUM | 0:2c9585cecfde | 17 | pc.printf("%2.2f degC, %04.2f hPa, %2.2f %%\n", sensor.getTemperature(), sensor.getPressure(), sensor.getHumidity()); |
MACRUM | 0:2c9585cecfde | 18 | wait(1); |
MACRUM | 0:2c9585cecfde | 19 | } |
MACRUM | 0:2c9585cecfde | 20 | } |