RYU HoSeong

Dependencies:   HC_SR04_Ultrasonic_Library mbed-rtos mbed-src mbed HCSR04

Fork of Nucleo_UltrasonicHelloWorld by EJ Teb

Files at this revision

API Documentation at this revision

Comitter:
ryuhs74
Date:
Mon Aug 10 01:02:41 2015 +0000
Parent:
5:e1849ee9651d
Commit message:
create;

Changed in this revision

HCSR04.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/HCSR04.lib	Fri Aug 07 14:39:58 2015 +0000
+++ b/HCSR04.lib	Mon Aug 10 01:02:41 2015 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/antoniolinux/code/HCSR04/#86b2086be101
+https://developer.mbed.org/users/ryuhs74/code/HCSR04/#a6912eacfb20
--- a/main.cpp	Fri Aug 07 14:39:58 2015 +0000
+++ b/main.cpp	Mon Aug 10 01:02:41 2015 +0000
@@ -13,6 +13,8 @@
 #include "rtos.h"
 #endif
 
+#define  CHECK_DISTANCE 1000
+
 int sum_dist[3] = {0,}; //ryuhs74@20150712 - 
 int avg_dist = 0; //ryuhs74@20150712 - 
 int index_dist = 0; //ryuhs74@20150712 - 
@@ -105,7 +107,7 @@
             
             //avg_dist /= avg_dist;
             
-            if( avg_dist <= 1 ){
+            if( avg_dist <= CHECK_DISTANCE ){
                 #ifdef USE_THREAD
                 if( isRun_thread == 0 ){
                     Thread thread(camera_thread);
@@ -114,6 +116,7 @@
                         pThread = (Thread*)&thread;
                     
                 }
+                #else
                 #endif
                 
             }