Revised for integration

Dependencies:   QEI2 chair_BNO055 PID VL53L1X_Filter

Revision:
26:e06e67411fc9
Parent:
21:3489cffad196
--- a/wheelchair.cpp	Fri Apr 19 23:06:53 2019 +0000
+++ b/wheelchair.cpp	Wed Jun 26 18:20:11 2019 +0000
@@ -12,6 +12,8 @@
 
 double dist_old, curr_pos;                                                             // Variables for odometry position
 
+DigitalOut signal(D5);
+DigitalIn button(D4, PullDown);
  
 PID myPID(&pid_yaw, &Output, &Setpoint, 5.5, .00, 0.0036, P_ON_E, DIRECT);             // Angle PID object constructor
 PID myPIDDistance(&Input, &Output, &Setpoint, 5.5, .00, 0.002, P_ON_E, DIRECT);        // Distance PID object constructor
@@ -35,6 +37,26 @@
     curr_pos = wheel->getDistance(53.975);
 }
 
+void Wheelchair::emergencyButton_thread () {
+    while(1) {
+        signal = 0;
+        while(!button) {
+                    
+            //Send something to stop wheelchair
+            signal = 1;
+            
+            printf("Hello there!\n");
+            printf("I'm dead\n\n\n");
+            
+            //Reset Board
+            NVIC_SystemReset();
+
+        }
+    
+    }
+}
+
+
 void Wheelchair::assistSafe_thread()
 {
     int ToFV[12];