Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Victor SP (http://www.chiefdelphi.com/forums/showthread.php?t=153444)

GuyWithAHoodie 11-01-2017 10:47

Victor SP
 
Hello, I'm new to programming and FRC in general, Trying to learn the coding aspect.

Does anyone have example Victor SP code or just tips in general?
Everything is helpful.

Thanks.

AustinShalit 11-01-2017 12:19

Re: Victor SP
 
Quote:

Originally Posted by GuyWithAHoodie (Post 1629205)
Hello, I'm new to programming and FRC in general, Trying to learn the coding aspect.

Does anyone have example Victor SP code or just tips in general?
Everything is helpful.

Thanks.

I would take a look at RobotBuilder to get started. It will set up your java project for you and make the code clear.

Getting stated with RobotBuilder:
https://wpilib.screenstepslive.com/s...f-robotbuilder

Video series explaining how it works:
https://www.youtube.com/playlist?lis...wtlgnvhGObeKzp

cttxzombieslaya 11-01-2017 17:12

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


All times are GMT -5. The time now is 12:33.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi