Lab 6 code.
Dependencies: mbed
Fork of WaG by
Revision 56:048b30c9f2a1, committed 2018-04-06
- Comitter:
- spm71
- Date:
- Fri Apr 06 18:25:19 2018 +0000
- Parent:
- 55:1a25dd75e309
- Commit message:
- Final update
Changed in this revision
diff -r 1a25dd75e309 -r 048b30c9f2a1 analog.h --- 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
diff -r 1a25dd75e309 -r 048b30c9f2a1 main.cpp --- 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);
diff -r 1a25dd75e309 -r 048b30c9f2a1 stepper.cpp --- 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;