|
Re: Motor Limits
We're using limit switches to do the same type of thing. Two limit switches came in the kit.
If your motor was hooked to pwm01 you'd use...
Limit_Switch_Max(rc_dig_in01, &pwm01);
Limit_Switch_Min(rc_dig_in02, &pwm01);
That would (should) stop your turret's turning as soon as it hits the limit switches.
DISCLAIMER: I have not yet physically tested this yet, I didn't use any limit switches last year, and didn't get to test if that was stopping our turret today. I compiled and uploaded, but never tested the switches. That *should* work though.
You could also do it with a pot (I originally tried this way) but the limit switch, in my opinion, is much easier.
Last edited by ForgottenSalad : 04-02-2006 at 01:51.
|