Thread: Motor Limits
View Single Post
  #2   Spotlight this post!  
Unread 04-02-2006, 01:46
ForgottenSalad's Avatar
ForgottenSalad ForgottenSalad is offline
In search of a home...
AKA: Michael Wessler
no team
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Bethlehem, NH
Posts: 136
ForgottenSalad will become famous soon enoughForgottenSalad will become famous soon enough
Send a message via AIM to ForgottenSalad
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.