View Single Post
  #1   Spotlight this post!  
Unread 01-02-2013, 19:28
r0306 r0306 is offline
Registered User
AKA: Robert Lu
FRC #0253 (MRT)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2010
Location: California
Posts: 13
r0306 is an unknown quantity at this point
Program Motor to Make One Exact Revolution

We're using a 12V Tetrix Motor connected to a spike. Right now, we're trying to program the motor so that it starts and ends in the exact position but it never seems to do so. Please help.

Here is the current code we're using:

Code:
            if (leftStick.getRawButton(3))
            {
                              
                    piston.set(Relay.Value.kForward);

                    new java.util.Timer().schedule(new TimerTask() {          
   
                    public void run() {
           
                        piston.set(Relay.Value.kOff);
                            
                   }
             }, 1000L); //motor spins for one second
               
            }

Last edited by r0306 : 01-02-2013 at 19:40.
Reply With Quote