BTSSN Projet Drone Imagerie Télémétrie
/
MPL115A1_HelloWorld
Testé pour projet BTS SN
Fork of MPL115A1_HelloWorld by
main.cpp
- Committer:
- Parkz
- Date:
- 2013-11-07
- Revision:
- 0:b03929952ce3
- Child:
- 1:3bdc0f29c3ae
File content as of revision 0:b03929952ce3:
#include "mbed.h" #include "mpl115a1.h" Serial pc(USBTX,USBRX); int main() { // Chip must be deselected cs = 1; // Setup the spi for 8 bit data, high steady state clock, // second edge capture, with a 8MHz clock rate spi.format(8,0); spi.frequency(8000000); //Chip selscted cs=0; while(1) { float pressure_pKa = 0; sdn=1; wait(0.02); pressure_pKa = calculatePressurekPa(); pc.printf("Pressure=%d",pressure_pKa); sdn=0; wait(5); } }