View Single Post
  #3   Spotlight this post!  
Unread 30-01-2006, 20:02
EricWilliams EricWilliams is offline
Registered User
FRC #2039 (Rockford Robotics)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2001
Location: Rockford, IL
Posts: 103
EricWilliams is a glorious beacon of lightEricWilliams is a glorious beacon of lightEricWilliams is a glorious beacon of lightEricWilliams is a glorious beacon of lightEricWilliams is a glorious beacon of lightEricWilliams is a glorious beacon of light
Re: Using a switch with a victor

Try something like this:
Code:
if(switch = open){
  if(motor speed < 255){
    motor speed += User_Acceleration;
  }
  if(switch = cosed){
    if(motor speed > 127){
      motor speed -= User_Acceleration;
    }
  }
}
Obviously this isn't copy and paste code, but I think you can figure it out from here. You want to increment the motor speed so that you don't add extra wear and tear on your gear/transmission box. If you want to reverse the motor, you need to add another conditional under each main condition.

Good luck.

**Props to Drew Shapiro (huge white kid with a 'fro) for comming up with this scheme.** - He doesn't like it when I steal his code.

Last edited by EricWilliams : 30-01-2006 at 20:09.