HOme Sheriff And Lamp

Dependencies:   CameraC328 HCSR04 SDFileSystem WIZnetInterface mbed

Fork of HoSAL by pi bae

Revision:
8:28f7b30c1ae4
Parent:
2:3c7526a1893a
--- 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;