BTSSN Projet Drone Imagerie Télémétrie
/
MPL115A1_HelloWorld
Testé pour projet BTS SN
Fork of MPL115A1_HelloWorld by
Embed:
(wiki syntax)
Show/hide line numbers
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 }
Generated on Wed Jul 13 2022 07:08:14 by 1.7.2