|
Re: Limit Switches help.
What it looks like the original poster wants to do is limit the motion of a motor based on whether a limit switch is active.
It looks like you want the motor to go only in reverse (less than 127) when that switch is active. I'm not too good with C, but in pbasic, you'd use the MAX and MIN declarations, e.g.
p1_y = p1_y MAX 127 MIN 0
I'm not sure if there is an equivalent in C, or how it would be implemented, but I think that's what you'd be looking for- to set that condition when the switch is enabled.
|