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:
- 2:c799e2dde99f
- Parent:
- 1:2611f01f2e9b
- Child:
- 3:f70ecf1e21d5
--- a/main.cpp Sat Nov 16 09:05:41 2019 +0000
+++ b/main.cpp Sun Nov 17 10:08:05 2019 +0000
@@ -8,14 +8,16 @@
Serial pc(USBTX,USBRX); // tx, rx
JPEGCamera camera(p9, p10); // TX, RX
int main(){
+ int i=1;
float th;
Timer tm;
+ for(i=0;i<3;i++){
pc.printf("start\r\n");
bool detected=false;
thermo=0; //焦電off
Ultra=1;//超音波on
- printf("超音波on焦電off ;
+ printf("超音波on 焦電off" ) ;
while(1) {
hs.TrigerOut();
wait(1);
@@ -30,6 +32,7 @@
if(true)
th = thermo;
if(th=1 && !detected) {//焦電反応ありの場合
+ i++;
detected=true;
pc.printf("human\r\n");
tm.reset();
@@ -40,7 +43,7 @@
timer.start();
camera.setPictureSize(JPEGCamera::SIZE320x240);
- for (int i = 0; i < 1; i++) {
+
if (camera.isReady()) {
char filename[32];
sprintf(filename, "/local/pict%03d.jpg",i);
@@ -56,7 +59,7 @@
} else {
printf("camera is not ready\r\n");
}
- }
+
printf("time = %f\n", timer.read());
}
@@ -68,5 +71,5 @@
}
}
-
+ }
\ No newline at end of file