Testé pour projet BTS SN

Dependencies:   MPL115A1 mbed

Fork of MPL115A1_HelloWorld by Christian Dupaty

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002  #include "MPL115A1.h"
00003  
00004 SPI spi(SPI_MOSI,SPI_MISO,SPI_SCK);
00005 MPL115A1 bar(spi, SPI_CS);
00006  
00007 Serial pc(USBTX, USBRX);
00008  
00009 int main() {
00010     while(1) {
00011         wait(10);
00012         pc.printf("Pressure is %f\n", bar.readPressure());  // en kPa
00013         pc.printf("Temperature is %f\n", bar.readTemperature()); // en degC... temperature non compense
00014     }
00015 }