Test of the BMP180 sensor (Temperature and pression) with the nRF51822 platform.
Fork of BMP180_example by
Revision 3:43e6a2416ddf, committed 2015-10-16
- Comitter:
- yanndouze
- Date:
- Fri Oct 16 14:53:16 2015 +0000
- Parent:
- 2:20c4b5932337
- Commit message:
- Test of the BMP180 Sensor (pression and temperature) with the nRF51822 platform.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 20c4b5932337 -r 43e6a2416ddf main.cpp --- a/main.cpp Fri Apr 17 15:48:08 2015 +0000 +++ b/main.cpp Fri Oct 16 14:53:16 2015 +0000 @@ -2,16 +2,16 @@ #include "mbed.h" #include "BMP180.h" -I2C i2c(I2C_SDA, I2C_SCL); +I2C i2c(D14, D15); BMP180 bmp180(&i2c); int main(void) { while(1) { if (bmp180.init() != 0) { - printf("Error communicating with BMP180\n"); + printf("Error communicating with BMP180\r\n"); } else { - printf("Initialized BMP180\n"); + printf("Initialized BMP180\r\n"); break; } wait(1); @@ -22,7 +22,7 @@ wait_ms(5); // Wait for conversion to complete float temp; if(bmp180.getTemperature(&temp) != 0) { - printf("Error getting temperature\n"); + printf("Error getting temperature\r\n"); continue; } @@ -30,11 +30,11 @@ wait_ms(10); // Wait for conversion to complete int pressure; if(bmp180.getPressure(&pressure) != 0) { - printf("Error getting pressure\n"); + printf("Error getting pressure\r\n"); continue; } - printf("Pressure = %d Pa Temperature = %f C\n", pressure, temp); + printf("Pressure = %d Pa Temperature = %f C\r\n", pressure, temp); wait(1); } } \ No newline at end of file
diff -r 20c4b5932337 -r 43e6a2416ddf mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Oct 16 14:53:16 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/bad568076d81 \ No newline at end of file