Moved to Team 9.

Fork of LineScan by Nicholas Gan

Revision:
20:e9f0d1483ba1
Parent:
19:5a29c887c8eb
Child:
24:774104c34063
Child:
28:3006d46dcec5
Child:
37:b76faff78354
--- a/LineScan.cpp	Thu Apr 23 17:40:02 2015 +0000
+++ b/LineScan.cpp	Sat Apr 25 02:42:06 2015 +0000
@@ -1,10 +1,10 @@
 #include "LineScan.h"
 #include <string.h>
 
-#define THRESH 5000
+#define THRESH 2000
 
-#define MEAN_REF 30000      //ideal mean we should see
-#define CAM_CTRL_GAIN 0.0001 //should be small
+#define MEAN_REF 10000      //ideal mean we should see
+#define CAM_CTRL_GAIN 0.0003 //should be small
 
 #define NEUTRAL 0
 #define FIND_PEAK 1
@@ -127,11 +127,6 @@
             *exposure = UPDATE_RATE;
     }
     
-    //zero pad the telemetry
-    for(i = frameLen; i < NUM_PIX; i++){
-        //tele_linescan_diff[i] = 0;
-    }
-    
     l_walker = l_idx_ary;
     h_walker = h_idx_ary;
     
@@ -140,7 +135,7 @@
         //if interval is black on white, advance the pointer for the peak array
         //width needs to be larger than 4 pixels wide to be a good read.
         
-        if(*h_walker > *l_walker && (*h_walker - *l_walker) < out_width && (*h_walker - *l_walker) > 4){
+        if(*h_walker > *l_walker && (*h_walker - *l_walker) < out_width && (*h_walker - *l_walker) > 3){
             out_width = *h_walker - *l_walker;
             out = ((float)(*h_walker + *l_walker)) / (2.0 * (float)frameLen);    //0.5 is center
             l_walker++;