Thread: [FTC]: Encoders
View Single Post
  #2   Spotlight this post!  
Unread 18-02-2009, 08:43
gdo's Avatar
gdo gdo is offline
Never too much duct-tape ;)
AKA: Patrick
FTC #0001 (Team Unlimited)
Team Role: Engineer
 
Join Date: Dec 2005
Rookie Year: 2001
Location: MA
Posts: 131
gdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to behold
Send a message via AIM to gdo Send a message via MSN to gdo
Re: [FTC]: Encoders

Which language?

If you are using RobotC, this will work

Quote:
nMotorEncoder[YOUR_MOTOR1_HERE] = 0;
nMotorEncoder[YOUR_MOTOR2_HERE] = 0;
nMotorEncoderTarget[YOUR_MOTOR1_HERE] = X_Distance;
nMotorEncoderTarget[YOUR_MOTOR2_HERE] = X_Distance;
motor[YOUR_MOTOR1_HERE] = 100;
motor[YOUR_MOTOR2_HERE] = 100;
Just substitute "YOUR_MOTOR1_HERE" and "YOUR_MOTOR2_HERE" for the names of the motors you are using, and then substitute "X_Distance" for the number of rotations you want to travel.
__________________



FTC #1: http://unlimited.syraweb.org

Got any question for me; AIM, MSN or PM me
Reply With Quote