The program is supposed to run the motor until the remote control lever isn't pushed the right distance, creating a different pulse width. The PWM is just fine, that isn't the problem. So far, when the lever is pushed over to the area of speed two or three, it will run the motor until the stop button is pushed. I need it to run the motor until the lever is no longer creating the right pulse. This is why I've attempted to change run_motor1. Since this program needs to be controlled by remote control only, I nee the run_motor1 subroutine to recognize the widthx value, and return to main when the lever is in a different position. I haven't had luck with the hardware PWM or HPWM command. Calculating the pulse on and off time is more reliable. I just can't make it recognize the pulse when in the subroutine, in order to return to the main program.
Bookmarks