GroupA / Mbed 2 deprecated Lab_6_WaG

Dependencies:   mbed

Fork of WaG by GroupA

Revision:
55:1a25dd75e309
Parent:
54:d5a95bc8ffb0
Child:
56:048b30c9f2a1
--- a/main.cpp	Thu Apr 05 20:32:04 2018 +0000
+++ b/main.cpp	Thu Apr 05 21:16:59 2018 +0000
@@ -37,7 +37,7 @@
 AnalogIn mux_out (MUX_OUT);
 BusOut mux_select(MUX_S0, MUX_S1, MUX_S2, MUX_S3);
 int station = -1;
-int *cal_status = NOT_CALIBRATED;
+int cal_status = NOT_CALIBRATED;
 float sensor_values[TGT_SENSOR_QUAN * 2];
 int stp_sensor_pos[TGT_SENSOR_QUAN];
 
@@ -62,7 +62,6 @@
     /*
     pc.printf("Press user button to test.\n");
     
-
     test_target_leds();
     pc.printf("LED's tested\n");
     
@@ -92,11 +91,11 @@
     */
     /** Part 9: calibration test **/
     pc.printf("Part 9: calibration test begin.\n");
-    stp_calibrate(station, sensor_values, cal_status);
+    stp_calibrate(station, sensor_values, &cal_status);
     pc.printf("Part 9: calibration test done.\n");
     
     
-   // stp_sensor_pos[0] = 27;
+    //stp_sensor_pos[0] = 27;
     //stp_sensor_pos[1] = 50;
     //stp_sensor_pos[2] = 72;
     //stp_sensor_pos[3] = 98;
@@ -104,9 +103,7 @@
     //stp_sensor_pos[5] = 146;
     //stp_sensor_pos[6] = 173;
     //stp_sensor_pos[7] = 197;
-    
-    stp_find_home();
-    
+        
     // turn on laser 
     lzr_on();
     
@@ -118,7 +115,7 @@
         if (station == STATION_B) sensor_no = 8;
         
         // move to the left most sensor
-        repeatability_test(0, *cal_status);
+        repeatability_test(0, cal_status);
         
         // read sensor value
         ana_scan_mux(sensor_values, TGT_SENSOR_QUAN * 2);
@@ -127,13 +124,13 @@
         pc.printf("Sensor %d: %f\n", sensor_no, sensor_values[sensor_no] * 3.3f);
         
         // move to the right most sensor
-        repeatability_test(TGT_SENSOR_QUAN - 1, *cal_status);
+        repeatability_test(TGT_SENSOR_QUAN - 1, cal_status);
         
         // read sensor value
         ana_scan_mux(sensor_values, TGT_SENSOR_QUAN * 2);
         
         // print value
-        pc.printf("Sensor %d: %f\n", sensor_no + TGT_SENSOR_QUAN, sensor_values[sensor_no + TGT_SENSOR_QUAN - 1] * 3.3f);
+        pc.printf("Sensor %d: %f\n", sensor_no + TGT_SENSOR_QUAN - 1, sensor_values[sensor_no + TGT_SENSOR_QUAN - 1] * 3.3f);
     }
     pc.printf("Part 10: repeatibility test done.\n");
 } 
\ No newline at end of file