Moved to Team 9.

Fork of LineScan by Nicholas Gan

Revision:
19:5a29c887c8eb
Parent:
18:8a65598abf2f
Child:
20:e9f0d1483ba1
--- a/LineScan.cpp	Wed Apr 22 02:05:47 2015 +0000
+++ b/LineScan.cpp	Thu Apr 23 17:40:02 2015 +0000
@@ -3,8 +3,8 @@
 
 #define THRESH 5000
 
-#define MEAN_REF 20000      //ideal mean we should see
-#define CAM_CTRL_GAIN 0.0009 //should be small
+#define MEAN_REF 30000      //ideal mean we should see
+#define CAM_CTRL_GAIN 0.0001 //should be small
 
 #define NEUTRAL 0
 #define FIND_PEAK 1
@@ -31,7 +31,7 @@
     *camClk = 0;
 }
 
-float processFn(uint16_t *array, int arraySz, int* exposure, telemetry::NumericArray<uint16_t, NUM_PIX> &tele_linescan_diff){
+float processFn(uint16_t *array, int arraySz, int* exposure){//, telemetry::NumericArray<uint16_t, NUM_PIX> &tele_linescan_diff){
     const static int frameLen = NUM_PIX -  2 * SKIP;
     int avg[frameLen];
     int diff[frameLen];
@@ -57,14 +57,14 @@
     if(array){    
         avg[0] = array[SKIP - 1]/2 + array[SKIP]/2;
         diff[0] = 0;
-        tele_linescan_diff[0] = diff[0];
+        //tele_linescan_diff[0] = diff[0];
         
         total += avg[0];    //AGC
         
         for(i = 1; i < frameLen; i++){
             avg[i] = array[i - 1 + SKIP]/2 + array[i + SKIP]/2;   //smoothing
             diff[i] = avg[i - 1] - avg[i];          //differential
-            tele_linescan_diff[i] = diff[i];
+            //tele_linescan_diff[i] = diff[i];
             
             total += avg[i];    //AGC
             
@@ -129,7 +129,7 @@
     
     //zero pad the telemetry
     for(i = frameLen; i < NUM_PIX; i++){
-        tele_linescan_diff[i] = 0;
+        //tele_linescan_diff[i] = 0;
     }
     
     l_walker = l_idx_ary;
@@ -159,8 +159,8 @@
                  DigitalOut *camSi, 
                  DigitalOut *camClk, 
                  int *exposure, 
-                 telemetry::NumericArray<uint16_t, NUM_PIX> &tele_linescan,
-                 telemetry::NumericArray<uint16_t, NUM_PIX> &tele_linescan_diff){
+                 telemetry::NumericArray<uint16_t, NUM_PIX> &tele_linescan){//,
+                 //telemetry::NumericArray<uint16_t, NUM_PIX> &tele_linescan_diff){
     uint16_t lineAry[NUM_PIX];
     float position;
     
@@ -172,7 +172,7 @@
     }
     
     //process line scan data
-    position  = processFn(lineAry, NUM_PIX, exposure, tele_linescan_diff);
+    position  = processFn(lineAry, NUM_PIX, exposure);//, tele_linescan_diff);
     //serial.printf("%.2f\r\n", position);
     
     return position;