Reference for the REV Robotics vendor library classes used in FRC Academy NEO motor lessons: SparkMax, SparkMaxConfig, SparkLowLevel.MotorType, and SparkBase.
Use this file to discover all available pages before exploring further.
The REV Robotics vendor library provides the Java classes needed to control SPARK MAX motor controllers and NEO brushless motors over CAN. FRC Academy’s NEO lessons use this library to demonstrate modern brushless motor configuration, follower setups, and safe parameter management through the Phoenix-style configuration object pattern.
Full class:com.revrobotics.spark.SparkMaxThe primary hardware control channel targeting modern brushless NEO motors via CAN. Each physical SPARK MAX on the robot’s CAN bus is represented by one SparkMax instance, identified by its device ID.Constructor
new SparkMax(int deviceID, MotorType type)
Parameter
Type
Description
deviceID
int
CAN ID of the SPARK MAX (e.g. 1)
type
MotorType
MotorType.kBrushless for NEO motors, MotorType.kBrushed for brushed motors
Key Methods
Method
Returns
Description
set(double speed)
void
Sets motor output in the range -1.0 (full reverse) to 1.0 (full forward)
Full class:com.revrobotics.spark.config.SparkMaxConfigA configuration object that holds hardware parameters — such as motor inversion and follower behavior — before they are applied to a SPARK MAX via configure(). Configuration objects are built up in code and then pushed to the controller in a single call, which is safer than setting parameters one at a time.Key Methods
Method
Returns
Description
inverted(boolean inverted)
SparkMaxConfig
Sets whether the motor output should be inverted
follow(SparkMax leader)
SparkMaxConfig
Configures this motor to mirror a leader motor
follow(SparkMax leader, boolean invert)
SparkMaxConfig
Follower with optional direction inversion relative to the leader
Example
SparkMaxConfig rightConfig = new SparkMaxConfig();rightConfig.inverted(true);m_rightMotor.configure( rightConfig, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
Full enum:com.revrobotics.spark.SparkLowLevel.MotorTypeAn enumeration passed to the SparkMax constructor to declare the type of motor attached to the controller.
Value
Use Case
MotorType.kBrushless
NEO brushless motors (most common in FRC Academy lessons)
Full class:com.revrobotics.spark.SparkBaseThe root abstract implementation layer that SparkMax extends. You will not instantiate this class directly, but it defines two important enums used in every configure() call.ResetMode
Value
Description
ResetMode.kResetSafeParameters
Resets the controller to safe default values before applying the new configuration
ResetMode.kNoResetSafeParameters
Applies configuration on top of existing parameters without resetting
PersistMode
Value
Description
PersistMode.kPersistParameters
Saves the configuration to the controller’s flash memory (survives power cycle)
PersistMode.kNoPersistParameters
Applies configuration in RAM only; reverts on reboot
Use SparkMaxConfig.follow() to set up a secondary motor that mirrors a leader — essential for multi-motor gearboxes where two motors drive the same shaft.
For a right-side gearbox, inversion is applied to the right lead motor via its own config object, and the right follower simply mirrors the lead without any inversion flag:
// Invert the right lead motor so both sides drive in the same robot directionSparkMaxConfig rightLeadConfig = new SparkMaxConfig();rightLeadConfig.inverted(true);m_rightLead.configure( rightLeadConfig, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);// Right follower mirrors the right lead exactly — no separate inversion neededSparkMaxConfig rightFollowConfig = new SparkMaxConfig();rightFollowConfig.follow(m_rightLead);m_rightFollow.configure( rightFollowConfig, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
The REV Robotics vendor library must be installed in your WPILib project via the vendor depot or by adding the JSON dependency URL. Use REV Hardware Client to update SPARK MAX firmware before use in competition.