FSG / Mbed 2 deprecated 7_20_17_FSG_

Dependencies:   BCEmotor Battery_Linear_Actuator_ Controller_ IMU_code_ LTC1298_7_14 MODSERIAL PosVelFilter_7_14 System_ mbed

Fork of 7_14_17_FSG_working by Troy Holley

Revision:
7:10d7fbac30ea
Parent:
6:ce2cf7f4d7d5
--- a/main.cpp	Fri Jul 21 13:32:10 2017 +0000
+++ b/main.cpp	Fri Jul 21 15:25:11 2017 +0000
@@ -123,13 +123,13 @@
     float positionCmd_temp;
     
     //set the intial gains for the position controller
-    posCon().setPgain(P);
+    /*posCon().setPgain(P);
     posCon().setIgain(I);
     posCon().setDgain(D);
     posCon().writeSetPoint(positionCmd);
     hBridge().reset();
     hBridge().run(motor_cmd);
-    
+    */
     /* *************************** LED *************************** */
     led1 = 1;   //initial values
     led2 = 1;
@@ -408,7 +408,7 @@
                 }
             }
             else if (Key == 'l' or Key == 'L') 
-                PC.printf("DEBUG: String position? %f velocity? %f (BCE active: %d)\n", pvf().getPosition(), pvf().getVelocity(),posCon().getOutput()); //DEBUG TROY
+                PC.printf("DEBUG: String position? %f velocity? %f (BCE active: %f)\n", pvf().getPosition(), pvf().getVelocity(),posCon().getOutput()); //DEBUG TROY
             
         //Linear Actuator Controls
             else if(Key == 'c' or Key == 'C')
@@ -640,6 +640,7 @@
                     pc().printf("Bad pot issue\n");
                     //hBridge().stop();
                     count = 0;
+
                 }
             
         }
@@ -647,6 +648,11 @@
         {
             pc().printf("Hit the limit switch??\n");
             hBridge().stop();
+            wait(1);
+            hBridge().reset();
+            positionCmd= 375;
+            posCon().writeSetPoint(positionCmd);
+            hBridge().run(posCon().getOutput());
         }
     
         //string snaps