2017能代宇宙イベント開放用プログラム(kobayashi)
Dependencies: mbed MS5607 MPU6050
Revision 1:fa1980f9b2d0, committed 2017-07-23
- Comitter:
- nene_kobayashi
- Date:
- Sun Jul 23 14:25:42 2017 +0000
- Parent:
- 0:027a3ffb7500
- Child:
- 2:3a7c38279b0b
- Commit message:
- ?????
Changed in this revision
MS5607.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MS5607.lib Sun Jul 23 14:25:42 2017 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/yamaguch/code/MS5607/#5760862143d1
--- 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; + } + } }