Updated with emergency button and watchdog code
Dependencies: QEI2 chair_BNO055 PID VL53L1X_Filter
Dependents: wheelchairControlSumer2019
Diff: wheelchair.h
- Revision:
- 30:a6659c5a8109
- Parent:
- 27:0b1a837f123c
diff -r 052247c0f0e0 -r a6659c5a8109 wheelchair.h --- a/wheelchair.h Thu Jun 27 22:54:46 2019 +0000 +++ b/wheelchair.h Fri Jun 28 17:00:27 2019 +0000 @@ -14,19 +14,20 @@ /* * Joystick has analog out of 200-700, scale values between 1.3 and 3.3 -*/ -#define def (2.5f/3.3f) //Default axis on joystick to stay neutral; used on x and y axis -#define high 3.3f/3.3f //High power on joystick; used on x and y axis -#define low (1.7f/3.3f) //Low power on joystick; used on x and y axis -#define offset .03f //Joystick adjustment to be able to go straight. Chair dependent on manufactoring precision -#define process .1 //Defines default time delay in seconds +*/ + +#define def (2.5f/3.3f) // Default axis on joystick to stay neutral; used on x and y axis +#define high 3.3f/3.3f // High power on joystick; used on x and y axis +#define low (1.7f/3.3f) // Low power on joystick; used on x and y axis +#define offset .03f // Joystick adjustment to be able to go straight. Chair dependent on manufactoring precision +#define process .1 // Defines default time delay in seconds /* Pin plug in for Nucleo-L432KC */ -#define xDir PA_6 //* PWM Pins */ +#define xDir PA_6 // PWM Pins #define yDir PA_5 -#define Encoder1 D7 //*Digital In Pull Up Pin */ +#define Encoder1 D7 // Digital In Pull Up Pin #define Encoder2 D8 -#define Diameter 31.75 //Diameter of encoder wheel +#define Diameter 31.75 // Diameter of encoder wheel #define maxDecelerationSlow 120 #define maxDecelerationFast 30 #define ToFSensorNum 12 @@ -115,7 +116,7 @@ double vel; double test1, test2; bool forwardSafety; - double curr_yaw, curr_velS; // Variable that contains current relative angle + double curr_yaw, curr_velS; // Variable that contains current relative angle private: