Quote:
Originally Posted by Ianuser
Thanks. How would I program pwm03 to stop when the switch goes on? I'm using a joystick to control pwm03, so when I set it to 127 if the switch is open wont it still not work because during the next loop (26 milisec later) pwm03 is still mapped to p3_y and thers not enough time for the joystick to go back to neutral position. they conflict dont they?
|
Yes, but you can use the limit switch as a condition to whether or not you will actually map p3_y to pwm03, like so:
Code:
if( rc_dig_in01 == OPEN ) {
pwm03 = p3_y;
} else { /* The limit switch is closed (tripped), force neutral */
pwm03 = 127;
}