Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API BMP180 mbed nRF51822
Fork of LinkNode_BMP180 by
Revision 3:b66abd88f595, committed 2016-01-28
- Comitter:
- helloqi
- Date:
- Thu Jan 28 01:38:38 2016 +0000
- Parent:
- 2:20c4b5932337
- Child:
- 4:e039f39e789d
- Commit message:
- 2016.01.28
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BLE_API.lib Thu Jan 28 01:38:38 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#bfc5b9b6ecf5
--- a/BMP180.lib Fri Apr 17 15:48:08 2015 +0000 +++ b/BMP180.lib Thu Jan 28 01:38:38 2016 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/users/kgills/code/BMP180/#b2219e6e444b +http://developer.mbed.org/users/kgills/code/BMP180/#068fdec73319
--- a/main.cpp Fri Apr 17 15:48:08 2015 +0000
+++ b/main.cpp Thu Jan 28 01:38:38 2016 +0000
@@ -2,34 +2,43 @@
#include "mbed.h"
#include "BMP180.h"
-I2C i2c(I2C_SDA, I2C_SCL);
+Serial pc(P0_23,P0_25);
+DigitalOut led(P0_20);
+I2C i2c(P0_17, P0_18);
BMP180 bmp180(&i2c);
-int main(void) {
-
- while(1) {
- if (bmp180.init() != 0) {
+int main(void)
+{
+ led=0;
+ while(1)
+ {
+ if (bmp180.init() != 0)
+ {
printf("Error communicating with BMP180\n");
- } else {
+ }
+ else
+ {
printf("Initialized BMP180\n");
break;
}
wait(1);
}
- while(1) {
+ while(1)
+ {
bmp180.startTemperature();
wait_ms(5); // Wait for conversion to complete
float temp;
- if(bmp180.getTemperature(&temp) != 0) {
+ if(bmp180.getTemperature(&temp) != 0)
+ {
printf("Error getting temperature\n");
continue;
}
-
bmp180.startPressure(BMP180::ULTRA_LOW_POWER);
wait_ms(10); // Wait for conversion to complete
int pressure;
- if(bmp180.getPressure(&pressure) != 0) {
+ if(bmp180.getPressure(&pressure) != 0)
+ {
printf("Error getting pressure\n");
continue;
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Jan 28 01:38:38 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4336505e4b1c \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nRF51822.lib Thu Jan 28 01:38:38 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#3cc0718d98d0
