Part 1
WPILib is our main source for everything related to FRC robot programming. Here is the main starting page for their website:
WPI is short for Worcester Polytechnic Institute, which is a college that maintains the code base that we build upon. On your own computer (Windows or Mac) it’s possible to install the tools and software needed that would allow you to get familiar with the programming environment and even try to compile some code without any robot hardware.
To do so, first install WPILIB software following steps here (NOTE: large 2.5 GB download):
Once installed, this page provides steps to generate an Example “Getting Started” program in Java, which is the language our team (uses along with 89% of FRC teams)
The goal of this step is to be able to simple “Build” this program and ensure it builds (compiles) clean without any errors.
Part 2:
Next we will attempt to create a simple program that builds and is deployable on our test Roborio platform to spin a motor in a forward or reverse direction.
First is to again follow similar steps as done before to generate an Example program, but instead we will want to select:
- Project Type: Template
- Language: Java
- Project Base: Command Robot
Once created, ensure it Builds without error. Next, we will be controlling the motor using a motor controller called a Talon SRX. We first need to install the vendor library for this. This can be done by:
- Choosing WPILiB: Manage Vendor Libraries, then Install new libraries (online).
You will then need to provide the URL path to a .json file provided by the maker Talon SRX. This can be found at:
- CTR Electronics: https://docs.ctr-electronics.com/
You will need to install both Phoenix 6 and Phoenix v5:

In the ExampleSubsystem.java, you will need to include these 2 new imports near the top of the file
- import com.ctre.phoenix.motorcontrol.NeutralMode;
- import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
Next we can simply declare the new TalonSRX object, instantiate it, and use the set() function with a value that will result in spinning the motor:
The set() command takes values between 1.0 and -1.0, where +/- represents different spinning directions. For this test, DO NOT SET THE MAX/MIN VALUEs, try values like 0.2 and -0.2.
Next ensure the code builds clean. If so, next step will be to deploy the code to the Roborio and enable it. But first we will need to install the FRC tools which includes the driver station. This is only available for Windows computers. To install follow steps at:
https://docs.wpilib.org/en/stable/docs/zero-to-robot/step-2/frc-game-tools.html
NOTE: If you are on a Mac, you can try this Driver Station code someone developed:
https://boomaa23.github.io/open-ds/#download
Once installed, you should be now able to connect to the Roborio WIFI, deploy and test your code to see if the motor spins. Work with a mentor or another student familiar with the process.
Extras:
For reference, this ~38 minute Youtube video created by an FRC team student provides a good introduction that is relates to creating a Test program in Java:
The slides presented in the video can be found here:
Programming Hitchhikers FRC Robotics
Some key points at it relates to our team:
- We use java.
- We use the command-based programming (vs. timed).
- We leverage (import) vendor libraries for motor controllers and sensors which are not included in the WPILIB install, examples:
- REV Robotics: https://docs.revrobotics.com/revlib
- CTR Electronics: https://docs.ctr-electronics.com/
- LaserCan from Grapple Robotics: https://grapplerobotics.au/product/lasercan/
Some potentially useful links:
- Misc FRC training videos mostly for software:
Lastly for future reference, here is a discussion board that is very heavily used by the FIRST community:
Link to download FRC Game Tools: https://packages.wpilib.workers.dev/game-tools/ni-frc-2024-game-tools_24.0.0_offline.iso