Test code for the BMP085 sensor (pression and temperature) with the nRF51822 platform.
Dependencies: BMP085 mbed nRF51822_blinky
Fork of nRF51822_blinky by
main.cpp@9:f7fb475f515a, 2015-10-16 (annotated)
- Committer:
- yanndouze
- Date:
- Fri Oct 16 13:06:54 2015 +0000
- Revision:
- 9:f7fb475f515a
- Parent:
- 7:053e387ebb6f
Test code for th BMP085 sensor (pressure and temperature) with nRF51822 platform.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dan | 0:7dec7e9ac085 | 1 | #include "mbed.h" |
yanndouze | 9:f7fb475f515a | 2 | #include "BMP085.h" |
dan | 0:7dec7e9ac085 | 3 | |
dan | 0:7dec7e9ac085 | 4 | DigitalOut myled(LED1); |
yanndouze | 9:f7fb475f515a | 5 | BMP085 bmp085(D14,D15); |
yanndouze | 9:f7fb475f515a | 6 | Serial pc(USBTX, USBRX); |
dan | 0:7dec7e9ac085 | 7 | |
dan | 0:7dec7e9ac085 | 8 | int main() { |
dan | 0:7dec7e9ac085 | 9 | while(1) { |
dan | 0:7dec7e9ac085 | 10 | myled = 1; |
RedBearLab | 7:053e387ebb6f | 11 | wait(1); |
yanndouze | 9:f7fb475f515a | 12 | |
yanndouze | 9:f7fb475f515a | 13 | bmp085.update(); |
yanndouze | 9:f7fb475f515a | 14 | pc.printf("Result --> p:%6.2f hPa / t:%6.2f C \r\n", bmp085.get_pressure(), bmp085.get_temperature()); |
yanndouze | 9:f7fb475f515a | 15 | |
dan | 0:7dec7e9ac085 | 16 | myled = 0; |
RedBearLab | 7:053e387ebb6f | 17 | wait(1); |
stevep | 4:81cea7a352b0 | 18 | } |
dan | 0:7dec7e9ac085 | 19 | } |