motor controller with P velocity control

Dependencies:   HIDScope PID QEI mbed EMG

Fork of PID_VelocityExample by Aaron Berk

Revision:
13:40141b362092
Parent:
12:d7bb475bb82d
Child:
14:102a2b4f5c86
Child:
22:ae8012b12890
--- a/inits.h	Tue Oct 06 10:51:02 2015 +0000
+++ b/inits.h	Tue Oct 06 11:30:38 2015 +0000
@@ -3,7 +3,7 @@
 //****************************************************************************/
 #define RATE  0.01 
 #define Kc    0.30
-#define Ti    0.15
+#define Ti    0.20
 #define Td    0.0
 
 //****************************************************************************/
@@ -12,6 +12,8 @@
 Serial pc(USBTX, USBRX);
 HIDScope    scope(3);        // Instantize a 2-channel HIDScope object
 Ticker      scopeTimer;      // Instantize the timer for sending data to the PC 
+InterruptIn startButton(D3);
+InterruptIn stopButton(D2);
 //--------
 // Motors 
 //--------
@@ -36,7 +38,7 @@
 Timer endTimer;
 Ticker motorControlTicker;
 bool goFlag=false;
-
+bool systemOn=false;
 // Working variables.
 volatile int leftPulses     = 0;
 volatile int leftPrevPulses = 0;