hi I need to write a code for motor controller using interruptions.
I have to main code but has zero idea how to use interruptions in the code itself.
heres what i must do,can someone explain me how to use interruptions
Re-implement the software using
interrupts so that the controller buttons are not blocked during the ramp-up and ramp-down phases
of the operating cycle.
There are two buttons, start/stop on pin 3 and E-Stop on pin 2. The controller takes 10 seconds to
ramp from zero to full power. Pressing the start/stop button causes the ramp up to commence, after
that if the stop button is pressed the controller will ramp back down to zero from whatever power
level it is currently at. If the E-Stop button is pressed the controller will immediately stop the motor.
#define DEBUG_MODE
#define MOTOR_DRIVE 11 // Motor output PWM on Pin 11
#define E_STOP 2 // Emergency Stop on Pin 2
#define RUN_STOP 3 // Start/Stop on Pin 3
#define PMAX 255 // MAX Power 100%
#define RAMP_DELAY int(10000/PMAX) // Ten Second Ramp Time