View Single Post
  #3   Spotlight this post!  
Unread 17-12-2007, 20:00
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 6,991
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Using a limit switch to limit motion

If you are holding the joystick against the limit, then what code allows the motor to 'reverse' when it hist the switch? Don't let it do that, just make it so the motor won't see a PWM value on the "too far" side of 127.

Pseudo Pseudocode:

Code:
Do Tank Drive
While (Limit_Switch_Too_Far_Up=1)
  If Motor Input < 127, then Motor Input = 127
End While
Don
__________________

I am N2IRZ - What's your callsign?