Testé pour projet BTS SN

Dependencies:   MPL115A1 mbed

Fork of MPL115A1_HelloWorld by Christian Dupaty

main.cpp

Committer:
cdupaty
Date:
2016-04-30
Revision:
1:3bdc0f29c3ae
Parent:
0:b03929952ce3

File content as of revision 1:3bdc0f29c3ae:

#include "mbed.h"
 #include "MPL115A1.h"
 
SPI spi(SPI_MOSI,SPI_MISO,SPI_SCK);
MPL115A1 bar(spi, SPI_CS);
 
Serial pc(USBTX, USBRX);
 
int main() {
    while(1) {
        wait(10);
        pc.printf("Pressure is %f\n", bar.readPressure());  // en kPa
        pc.printf("Temperature is %f\n", bar.readTemperature()); // en degC... temperature non compense
    }
}