UVic Assistive Technology Lab / Mbed 2 deprecated DSLR_Camera_Gimbal

Dependencies:   mbed ros_lib_kinetic

Revision:
1:1ac7d472cfa2
Parent:
0:3a767f41cf04
Child:
2:0537a8007a39
--- a/main.cpp	Wed Jan 31 05:24:12 2018 +0000
+++ b/main.cpp	Tue Feb 06 20:50:55 2018 +0000
@@ -25,13 +25,15 @@
 DigitalOut          LED(PA_5);
 PwmOut              liftSpeed(D10); // Normally D10
 DigitalOut          liftDirection(D11);
-DigitalIn           hallSensor1(D9);
-DigitalIn           hallSensor2(D12);
+//DigitalIn           hallSensor1(D9);
+//DigitalIn           hallSensor2(D12);
 DigitalIn           button(USER_BUTTON);
 Ticker              hallInt;
 Ticker              dynaInt;
 Ticker              imuInt;
 Ticker              rosInt;
+Ticker              liftInt;
+Timer               filter_hall1;
 BNO055              IMU(D14, D15);
 DynamixelClass      gimbal(57600, D7, D8, D2);
 
@@ -47,12 +49,14 @@
 bool            homeFlag = 0;
 bool            imuFlag = 0;
 bool            rosFlag = 0;
-int             currentPosition = LIFTHEIGHTMIN;
-bool            stall = FALSE;
+volatile int    currentPosition = 0;
+int             prevPosition = 0;
+bool            stall = false;
 
 // Main Program
 int main() {
     // Initializations
+    filter_hall1.start();                       //Start Filtering Timer
     setupGimbal();
     setupLift();                                // Lift
     setupROSNode(nh, sub);                      // ROS Node Handle