test

Dependencies:   BME280 mbed

Fork of BME280_Hello by Toyomasa Watarai

Committer:
kityann
Date:
Thu Aug 06 15:02:59 2015 +0000
Revision:
4:5a46e118c5f5
Parent:
0:2c9585cecfde
2015/08/07

Who changed what in which revision?

UserRevisionLine numberNew 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
MACRUM 0:2c9585cecfde 6 #if defined(TARGET_LPC1768)
kityann 4:5a46e118c5f5 7 BME280 sensor(p9, p10);
MACRUM 0:2c9585cecfde 8 #else
MACRUM 0:2c9585cecfde 9 BME280 sensor(I2C_SDA, I2C_SCL);
MACRUM 0:2c9585cecfde 10 #endif
MACRUM 0:2c9585cecfde 11
MACRUM 0:2c9585cecfde 12 int main() {
MACRUM 0:2c9585cecfde 13
MACRUM 0:2c9585cecfde 14 while(1) {
MACRUM 0:2c9585cecfde 15 pc.printf("%2.2f degC, %04.2f hPa, %2.2f %%\n", sensor.getTemperature(), sensor.getPressure(), sensor.getHumidity());
kityann 4:5a46e118c5f5 16 wait(0.1);
MACRUM 0:2c9585cecfde 17 }
MACRUM 0:2c9585cecfde 18 }