![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
main.cpp@0:2005beefb93e, 2011-10-17 (annotated)
- Committer:
- gbeardall
- Date:
- Mon Oct 17 10:41:08 2011 +0000
- Revision:
- 0:2005beefb93e
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gbeardall | 0:2005beefb93e | 1 | #include "mbed.h" |
gbeardall | 0:2005beefb93e | 2 | #include "BMP085.h" |
gbeardall | 0:2005beefb93e | 3 | |
gbeardall | 0:2005beefb93e | 4 | BMP085 bmp085(p28, p27); //bmp085(p9, p10); // sda, scl |
gbeardall | 0:2005beefb93e | 5 | |
gbeardall | 0:2005beefb93e | 6 | |
gbeardall | 0:2005beefb93e | 7 | DigitalOut myled(LED1); |
gbeardall | 0:2005beefb93e | 8 | Serial pc(USBTX, USBRX); |
gbeardall | 0:2005beefb93e | 9 | |
gbeardall | 0:2005beefb93e | 10 | int main() { |
gbeardall | 0:2005beefb93e | 11 | while(1) { |
gbeardall | 0:2005beefb93e | 12 | myled = 1; |
gbeardall | 0:2005beefb93e | 13 | |
gbeardall | 0:2005beefb93e | 14 | bmp085.update(); |
gbeardall | 0:2005beefb93e | 15 | pc.printf("p:%6.2f hPa / t:%6.2f C\n\r", bmp085.get_pressure(), bmp085.get_temperature()); |
gbeardall | 0:2005beefb93e | 16 | |
gbeardall | 0:2005beefb93e | 17 | myled = 0; |
gbeardall | 0:2005beefb93e | 18 | wait(3); |
gbeardall | 0:2005beefb93e | 19 | } |
gbeardall | 0:2005beefb93e | 20 | } |