HOme Sheriff And Lamp
Dependencies: CameraC328 HCSR04 SDFileSystem WIZnetInterface mbed
Fork of HoSAL by
Revision 8:28f7b30c1ae4, committed 2015-08-11
- Comitter:
- uasonice
- Date:
- Tue Aug 11 19:20:46 2015 +0000
- Parent:
- 7:58b14840531c
- Child:
- 9:416cbcabbddd
- Commit message:
- update: camera baud rate 38400; speed up U.sonic distance measure
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| rev_Hcsr04.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Aug 11 19:07:44 2015 +0000
+++ b/main.cpp Tue Aug 11 19:20:46 2015 +0000
@@ -99,7 +99,8 @@
#if defined(USE_CAMERA)
DM_fLN("Init camera C328");
- g_pCam = new CameraC328(PA_13, PA_14, CameraC328::Baud14400);
+ //g_pCam = new CameraC328(PA_13, PA_14, CameraC328::Baud14400);
+ g_pCam = new CameraC328(PA_13, PA_14, CameraC328::Baud38400);
revSync(g_pCam);
#if 0
tm1.reset();
--- a/rev_Hcsr04.cpp Tue Aug 11 19:07:44 2015 +0000
+++ b/rev_Hcsr04.cpp Tue Aug 11 19:20:46 2015 +0000
@@ -20,7 +20,6 @@
#if defined(USE_MEASURE_DISTANCE)
long avg_dist = 0;
-long distance_cm = 0; //ryuhs74@20150810 - Add
uint8_t index_dist = 0;
long sum_dist[3];
@@ -28,10 +27,9 @@
{
while (true) {
- distance_cm = pH->distance(); //ryuhs74@20150810 - cm 단위 측정 거리 return
if( index_dist < 3){ //ryuhs74@20150810
- sum_dist[index_dist] = distance_cm;
- DM_fLN("sum_dist[%d] = %d", index_dist, sum_dist[index_dist]);
+ sum_dist[index_dist] = pH->distance();;
+ //DM_fLN("sum_dist[%d] = %d", index_dist, sum_dist[index_dist]);
index_dist ++;
} else {
avg_dist = 0;
@@ -45,7 +43,7 @@
DM_fLN("avg: %d", avg_dist);
return avg_dist;
}
-#if 0
+#if 1
wait_ms(10);
#else
break;
