Thread: Victor SP
View Single Post
  #3   Spotlight this post!  
Unread 11-01-2017, 17:12
cttxzombieslaya cttxzombieslaya is offline
Registered User
AKA: Dillon Smithson
FRC #5864 (Robo Pelicans)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2015
Location: Port Allen
Posts: 2
cttxzombieslaya is an unknown quantity at this point
Re: Victor SP

I understand how difficult it can be especially when you're new to all of this, and I was last year.
But its pretty simple.

To first use anything in the VictorSP library you have to import the files into your program, which if your using the default programs that FRC provides (Sample, Iterative and Command) they have import commands lined up at the top of the program, so you can just put this up there to:

import edu.wpi.first.wpilibj.VictorSP;

Now you can use all of the VictorSP stuff now that you've put the library in.

to declare a Motor on your robot simply do this:

VictorSP leftMotor = new VictorSP(0);

The part where I put "leftMotor" can be changed of course, you can name it whatever you want. the last part "(0)" is the PWM port the motor is plugged into so make sure you have this right.

From here you can take them and start using your motors to program you driving functions.

If you have any questions you can message me cause i tend to leave so information out, but Im always here to help.
Hope you have a really awesome competition season!

~Dillon Smithson
Team 5864
Programmer
Reply With Quote