Lab 6 code.

Dependencies:   mbed

Fork of WaG by GroupA

Files at this revision

API Documentation at this revision

Comitter:
spm71
Date:
Fri Apr 06 18:25:19 2018 +0000
Parent:
55:1a25dd75e309
Commit message:
Final update

Changed in this revision

analog.h 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
stepper.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/analog.h	Thu Apr 05 21:16:59 2018 +0000
+++ b/analog.h	Fri Apr 06 18:25:19 2018 +0000
@@ -8,7 +8,7 @@
 * Purpose: Header for analog functions
 *
 * Created: 03/20/2018
-* Last Modified: 03/20/2018
+* Last Modified: 04/06/2018
 *
 ******************************************************************************/
 #ifndef ANALOG_H
--- a/main.cpp	Thu Apr 05 21:16:59 2018 +0000
+++ b/main.cpp	Fri Apr 06 18:25:19 2018 +0000
@@ -8,7 +8,7 @@
 * Purpose: Configures the dispaly for 4-digit display or motor control
 *
 * Created: 03/01/2018
-* Last Modified: 03/29/2018
+* Last Modified: 04/06/2018
 *
 ******************************************************************************/
 #include "mbed.h"
@@ -59,7 +59,7 @@
     spi_send(as1107, 0x0300);
     spi_send(as1107, 0x0400);
 
-    /*
+    
     pc.printf("Press user button to test.\n");
     
     test_target_leds();
@@ -67,10 +67,10 @@
     
     test_phototransistors();
     pc.printf("Phototransistors tested\n");
-    */
+    
     step_test();
     pc.printf("Step motor tested\n");
-    /*
+    
     pc.printf("laser test\n");
     while (my_button.read() == 0);
     pc.printf("test begin\n");
@@ -88,7 +88,7 @@
     // determine if the wag is connected to station A or station B
     station = station_select.read();
     pc.printf("station in main: %d\n", station);
-    */
+    
     /** Part 9: calibration test **/
     pc.printf("Part 9: calibration test begin.\n");
     stp_calibrate(station, sensor_values, &cal_status);
@@ -111,8 +111,8 @@
     pc.printf("Part 10: press user button to begin the test.\n");
     while (uti_chk_ubutton() == 0);
     while (uti_chk_ubutton() == 0) {
-        int sensor_no = 0;
-        if (station == STATION_B) sensor_no = 8;
+        int sensor_no = 8;
+        if (station == STATION_B) sensor_no = 0;
         
         // move to the left most sensor
         repeatability_test(0, cal_status);
--- a/stepper.cpp	Thu Apr 05 21:16:59 2018 +0000
+++ b/stepper.cpp	Fri Apr 06 18:25:19 2018 +0000
@@ -8,7 +8,7 @@
 * Purpose: Driver for stepper motor
 *
 * Created: 03/02/2018
-* Last Modified: 03/29/2018
+* Last Modified: 04/06/2018
 *
 ******************************************************************************/
 
@@ -211,7 +211,7 @@
     pc.printf("step 9 test begin\n");
     
     int sensor_no = 0;
-    if (station == STATION_A) sensor_no = 0;
+    if (station == STATION_A) sensor_no = 8;
     if (station == STATION_B) sensor_no = 0;