![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
2017能代宇宙イベント開放用プログラム(kobayashi)
Dependencies: mbed MS5607 MPU6050
Diff: main.cpp
- Revision:
- 1:fa1980f9b2d0
- Parent:
- 0:027a3ffb7500
- Child:
- 2:3a7c38279b0b
diff -r 027a3ffb7500 -r fa1980f9b2d0 main.cpp --- a/main.cpp Sun Jul 23 08:49:46 2017 +0000 +++ b/main.cpp Sun Jul 23 14:25:42 2017 +0000 @@ -1,12 +1,24 @@ #include "mbed.h" +#include "MS5607I2C.h" +MS5607I2C ms(p9,p10,false); DigitalOut myled(LED1); +float max; + int main() { - while(1) { - myled = 1; - wait(0.2); - myled = 0; - wait(0.2); + + max=0; + + while(1){ + + float alt = ms.getAltitude(); + + if(max <= alt){ + max = alt; + }else if(max > alt){ + myled = 1; + } + } }