Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Holden9607/FRC-Academy/llms.txt

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.

com.revrobotics.spark.*

SparkMax

Full class: com.revrobotics.spark.SparkMax The 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)
ParameterTypeDescription
deviceIDintCAN ID of the SPARK MAX (e.g. 1)
typeMotorTypeMotorType.kBrushless for NEO motors, MotorType.kBrushed for brushed motors
Key Methods
MethodReturnsDescription
set(double speed)voidSets motor output in the range -1.0 (full reverse) to 1.0 (full forward)
get()doubleReturns the last commanded speed
stopMotor()voidImmediately stops motor output
configure(SparkMaxConfig config, ResetMode resetMode, PersistMode persistMode)voidApplies a configuration object to the controller
getDeviceID()intReturns the CAN ID of this SPARK MAX
Example
import com.revrobotics.spark.SparkMax;
import com.revrobotics.spark.SparkLowLevel.MotorType;

private final SparkMax m_motor = new SparkMax(1, MotorType.kBrushless);
m_motor.set(0.5); // 50% forward

SparkMaxConfig

Full class: com.revrobotics.spark.config.SparkMaxConfig A 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
MethodReturnsDescription
inverted(boolean inverted)SparkMaxConfigSets whether the motor output should be inverted
follow(SparkMax leader)SparkMaxConfigConfigures this motor to mirror a leader motor
follow(SparkMax leader, boolean invert)SparkMaxConfigFollower with optional direction inversion relative to the leader
Example
SparkMaxConfig rightConfig = new SparkMaxConfig();
rightConfig.inverted(true);
m_rightMotor.configure(
    rightConfig,
    ResetMode.kResetSafeParameters,
    PersistMode.kPersistParameters
);

SparkLowLevel.MotorType

Full enum: com.revrobotics.spark.SparkLowLevel.MotorType An enumeration passed to the SparkMax constructor to declare the type of motor attached to the controller.
ValueUse Case
MotorType.kBrushlessNEO brushless motors (most common in FRC Academy lessons)
MotorType.kBrushedBrushed DC motors (CIM, Mini CIM, etc.)

SparkBase (abstract)

Full class: com.revrobotics.spark.SparkBase The 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
ValueDescription
ResetMode.kResetSafeParametersResets the controller to safe default values before applying the new configuration
ResetMode.kNoResetSafeParametersApplies configuration on top of existing parameters without resetting
PersistMode
ValueDescription
PersistMode.kPersistParametersSaves the configuration to the controller’s flash memory (survives power cycle)
PersistMode.kNoPersistParametersApplies configuration in RAM only; reverts on reboot

Follower Configuration Example

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.
SparkMaxConfig followerConfig = new SparkMaxConfig();
followerConfig.follow(m_leftMotor); // mirror leader exactly

m_leftFollower.configure(
    followerConfig,
    ResetMode.kResetSafeParameters,
    PersistMode.kPersistParameters
);
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 direction
SparkMaxConfig rightLeadConfig = new SparkMaxConfig();
rightLeadConfig.inverted(true);
m_rightLead.configure(
    rightLeadConfig,
    ResetMode.kResetSafeParameters,
    PersistMode.kPersistParameters
);

// Right follower mirrors the right lead exactly — no separate inversion needed
SparkMaxConfig 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.

CTRE Phoenix 6

TalonFX, DutyCycleOut, and Follower for Kraken x60 and Falcon 500 motors.

NEO Motor Guide

Wiring, CAN configuration, and FRC Academy lesson walkthrough for NEO motors.

Build docs developers (and LLMs) love