- Installing libraries Java/C++
- Building and Running Examples in Visual Studio
- Installing libraries LabVIEW
- Running Examples in LabVIEW
Download the SPARK-MAX-roboRIO-SDK from RevRobotics.
Extract the zipped archive to a location where you can find it. Within the extracted folder, there will be two folders title "maven" and "vendordeps".
Copy and paste these folders into the location C:\Users\Public\wpilib\2020. Replace the files in the destination if you are prompted.
Once the archive containing the SPARK-MAX-roboRIO-SDK has been extracted to the correct location, it can be installed in Visual Studio.
Begin by creating a new project in the language of your choice or by opening an existing project. Press ctrl + shift + p to bring up the command pallette and select WPILib: Manage Vendor Libraries
Then select Install new libraries (offline), check the box next to RevRobotics and select OK.
After a few moments SPARK MAX libraries will be available for you to use in your current project. This process will need to be repeated for each subsequent project that requires SPARK MAX libraries.
For Java all functions can be imported using import com.revrobotics.*;
. Similarly, for C++ use #include "rev/CANSparkMax.h
.
After cloning this GitHub repository, Java and C++ examples can be opened in Visual Studio by going to File->Open Folder... and selecting the parent folder of the example you want to run.
By default, the Team Number is set to 0 in the .wpilib/wpilib_preferences.json file. Make sure to change this to the Team Number configured on your roboRIO by either editing this file directly or by pressing ctrl + shift + p and selecting WPILib: Set Team Number.
Download the SPARK MAX LabVIEW API from RevRobotics here.
Simply run the installer and follow the instructions on screen.
Open LabVIEW and select File->Open Project.... Open the .lvproj file in the top directory of the example you wish to run.
By default the IP address of the roboRIO is set to 172.22.11.2. This IP address will work if you are connecting to the roboRIO over USB, but if you are connected over ethernet or WIFI you will need to right click Target, select Properties, and configure the IP set for your roboRIO.
Run the program by opening Robot Main.vi a pressing the white arrow at the top of the window.