Updated with emergency button and watchdog code

Dependencies:   QEI2 chair_BNO055 PID VL53L1X_Filter

Dependents:   wheelchairControlSumer2019

Revision:
28:6b2610acca97
Parent:
27:0b1a837f123c
Child:
29:052247c0f0e0
--- a/wheelchair.cpp	Thu Jun 27 18:08:29 2019 +0000
+++ b/wheelchair.cpp	Thu Jun 27 21:45:58 2019 +0000
@@ -12,8 +12,8 @@
 
 double dist_old, curr_pos;                                                             // Variables for odometry position
 
-DigitalOut signal(D5);                                                                 // Output to send "STOP" signal to wheelchair 
-DigitalIn button(D4, PullDown);                                                        // Emergency Stop button 
+//DigitalOut signal(D5);                                                                 // Output to send "STOP" signal to wheelchair 
+DigitalIn button(PD_0, PullUp);                                                        // Emergency Stop button 
  
 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
@@ -39,13 +39,11 @@
 
 void Wheelchair::emergencyButton_thread () {
     while(1) {
-        signal = 0;
+        //signal = 0;
         while(!button) {
                     
             //Send something to stop wheelchair
-            signal = 1;
-            
-            printf("Hello there!\n");
+            //signal = 1;
             printf("I'm dead\n\n\n");
             
             //Reset Board