Testé pour projet BTS SN

Dependencies:   MPL115A1 mbed

Fork of MPL115A1_HelloWorld by Christian Dupaty

Committer:
cdupaty
Date:
Sat Apr 30 17:07:31 2016 +0000
Revision:
1:3bdc0f29c3ae
Parent:
0:b03929952ce3
Test? pour projet BTS SN

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cdupaty 1:3bdc0f29c3ae 1 #include "mbed.h"
cdupaty 1:3bdc0f29c3ae 2 #include "MPL115A1.h"
cdupaty 1:3bdc0f29c3ae 3
cdupaty 1:3bdc0f29c3ae 4 SPI spi(SPI_MOSI,SPI_MISO,SPI_SCK);
cdupaty 1:3bdc0f29c3ae 5 MPL115A1 bar(spi, SPI_CS);
cdupaty 1:3bdc0f29c3ae 6
cdupaty 1:3bdc0f29c3ae 7 Serial pc(USBTX, USBRX);
cdupaty 1:3bdc0f29c3ae 8
cdupaty 1:3bdc0f29c3ae 9 int main() {
cdupaty 1:3bdc0f29c3ae 10 while(1) {
cdupaty 1:3bdc0f29c3ae 11 wait(10);
cdupaty 1:3bdc0f29c3ae 12 pc.printf("Pressure is %f\n", bar.readPressure()); // en kPa
cdupaty 1:3bdc0f29c3ae 13 pc.printf("Temperature is %f\n", bar.readTemperature()); // en degC... temperature non compense
cdupaty 1:3bdc0f29c3ae 14 }
cdupaty 1:3bdc0f29c3ae 15 }