Test code for the BMP085 sensor (pression and temperature) with the nRF51822 platform.

Dependencies:   BMP085 mbed nRF51822_blinky

Fork of nRF51822_blinky by RedBearLab

main.cpp

Committer:
yanndouze
Date:
2015-10-16
Revision:
9:f7fb475f515a
Parent:
7:053e387ebb6f

File content as of revision 9:f7fb475f515a:

#include "mbed.h"
#include "BMP085.h"

DigitalOut myled(LED1);
BMP085 bmp085(D14,D15);
Serial pc(USBTX, USBRX);

int main() {
    while(1) {
        myled = 1;
        wait(1);
        
        bmp085.update();
        pc.printf("Result --> p:%6.2f hPa / t:%6.2f C \r\n", bmp085.get_pressure(), bmp085.get_temperature());
 
        myled = 0;
        wait(1);
    }
}