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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 1:d174c4427e69
- Parent:
- 0:2acb3f965991
- Child:
- 2:95a9db056db1
--- a/main.cpp Wed Nov 13 05:12:54 2019 +0000
+++ b/main.cpp Fri Nov 15 12:42:26 2019 +0000
@@ -4,12 +4,11 @@
US015 hs(p12,p11);
DigitalOut thermo(p20);
DigitalOut Ultra(p12);
-Serial pc(USBTX, USBRX); // tx, rx
+Serial pc(USBTX,USBRX); // tx, rx
int main(){
float th;
Timer tm;
- pc.baud(115200);
pc.printf("start\r\n");
bool detected=false;
@@ -23,7 +22,7 @@
distance = hs.GetDistance();
printf("%d\r\n",distance);//距離出力
- if(distance<200){//超音波反応
+ if(distance<2000){//超音波反応
Ultra=0;//超音波off
thermo=1;//焦電on
if(true)
@@ -40,5 +39,6 @@
}
//while(true)
}
+ return 0;
}
\ No newline at end of file