GroupA / Mbed 2 deprecated WaG_final

Dependencies:   mbed

Fork of Lab_6_WaG by GroupA

Revision:
22:09dd6977576b
Parent:
21:88f9f280931b
Child:
23:3da1d39c1ae9
diff -r 88f9f280931b -r 09dd6977576b main.cpp
--- a/main.cpp	Wed Mar 07 00:50:57 2018 +0000
+++ b/main.cpp	Thu Mar 08 17:16:18 2018 +0000
@@ -5,10 +5,10 @@
 * 
 * Authors: Sam Morrison and Phong Nguyen 
 * File name: main.cpp
-* Purpose: Configures the dispaly for 4-digit display
+* Purpose: Configures the dispaly for 4-digit display or motor control
 *
 * Created: 03/01/2018
-* Last Modified: 03/02/2018
+* Last Modified: 03/08/2018
 *
 ******************************************************************************/
 #include "mbed.h"
@@ -20,14 +20,10 @@
 #include <stdio.h>
 #include <string.h>
 
-int data_length = 16;
-int frequency = 1000000;
-
-//DigitalOut SS(DSP_AS1107_NCS);
 SPI wag_spi(MOSI, MISO, SCLK);
 Serial pc(USBTX, USBRX);
 DigitalIn jog_cw(PF_14);
-DigitalIn jog_ccw(PF_13);
+DigitalIn jog_ccw(PE_13);
 
 struct spi_cfg as1107{
     SPI_AS1107_ID,
@@ -37,6 +33,7 @@
     AS1107_SPI_NO_BITS,
 };
 
+
 int main(void) {
     initial_setup(as1107);
     char bcd[4];
@@ -75,12 +72,15 @@
     else {
         jog_cw.mode(PullUp);
         jog_ccw.mode(PullUp);
+        stp_step(1);
         pc.printf("Press a pushbutton to turn step motor\n");
         while(1) {
             if (jog_ccw == 0) {
+                //pc.printf("turning CCW\n");
                 stp_step(STP_CCW);
             }
             if (jog_cw == 0) {
+                //pc.printf("turning CW\n");
                 stp_step(STP_CW);
             } 
         }