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:
- 3:f7f92004d3ac
- Parent:
- 2:d3675b786834
- Child:
- 4:7cffa8775a27
--- a/main.cpp Wed Nov 27 14:17:36 2019 +0000 +++ b/main.cpp Thu Nov 28 06:53:24 2019 +0000 @@ -29,7 +29,7 @@ bool detected=false; if(true){ th = thermo; - if(th=1 && !detected) {//焦電反応ありの場合 + if(th==1 && !detected) {//焦電反応ありの場合 detected=true; pc.printf("human\r\n"); tm.reset(); @@ -37,17 +37,20 @@ } else if(tm.read_ms()>5000){//焦電反応なしの場合 printf("not found\r\n"); + thermo=0; + printf("焦電OFF\r\n"); + Ultra=1; + printf("超音波ONっすよ!\r\n"); detected=false; } - } + }//if(true) }if(distance>2000){//超音波反応遠い printf("distance>2000だぞ\r\n"); } - //if(true) + //while(1) } return 0; -} - \ No newline at end of file +} \ No newline at end of file