alberthrocks

Victor code

Feb 9th, 2013
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. /* Victor sample code */
  2. /* LEARN FROM DA MASTER */
  3.  
  4. /* import the necessary stuff */
  5. import edu.wpi.first.wpilibj.Victor;
  6.  
  7. public class Something {
  8.     /* here, initialize the Victor controller variable - don't assign anything yet! */
  9.     Victor vicmotor;
  10.    
  11.     public void robotInit() {
  12.         /* here, actually assign the controller */
  13.         vicmotor = new Victor(2); // or some other num
  14.         /* etc. */
  15.     }
  16.     public void teleopPeriodic() {
  17.         /* here, set a speed like Jaguar */
  18.         vicmotor.set(1.0); // -1.0 < x < 1.0
  19.         /* etc. */
  20.     }
  21. }
  22. // tada
Advertisement
Add Comment
Please, Sign In to add comment