Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:d51aa991d297, committed 2020-11-28
- Comitter:
- naruu
- Date:
- Sat Nov 28 09:48:52 2020 +0000
- Parent:
- 0:c2d05d76f730
- Commit message:
- FET
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Nov 28 08:44:03 2020 +0000
+++ b/main.cpp Sat Nov 28 09:48:52 2020 +0000
@@ -1,15 +1,18 @@
#include "mbed.h"
#include "BMP180.h"
#include <math.h>
+#include <stdio.h>
#define PIN_SDA D4
#define PIN_SCL D5
Serial pc(SERIAL_TX,SERIAL_RX,921600);
Serial xbee(D1,D0);
+DigitalOut FET(D9);
+
int main(){
float x8;
-
+ FET=0;
BMP180 bmp180(PIN_SDA,PIN_SCL);
float pressure,temperature,altitude;
xbee.printf("\rstart!\n\r");
@@ -59,7 +62,7 @@
xbee.printf("--------------------------------\n\r");
x8 = y8;
wait(1);
- if(altitude==0){
+ if(speed<=0){
break;
}}
else{
@@ -67,6 +70,8 @@
wait(1);
}
}
-
+ FET=1;
+wait(20);
+FET=0;
return 0;
}
\ No newline at end of file