Namespace Structure
All WPILibC classes are in thefrc namespace.
Core Robot Classes
TimedRobot
Event-driven robot framework with periodic callbacks
DriverStation
Interface to FMS and driver station data
RobotController
Access to roboRIO system-level functions
RobotBase
Base class for all robot programs
Hardware I/O
Digital I/O
| Class | Header | Description |
|---|---|---|
DigitalInput | frc/DigitalInput.h | Read digital input signals |
DigitalOutput | frc/DigitalOutput.h | Control digital output signals |
Counter | frc/Counter.h | Count digital pulses and edges |
Encoder | frc/Encoder.h | Quadrature encoder support |
DutyCycle | frc/DutyCycle.h | Read PWM duty cycle signals |
DutyCycleEncoder | frc/DutyCycleEncoder.h | Absolute encoders using duty cycle |
Analog I/O
| Class | Header | Description |
|---|---|---|
AnalogInput | frc/AnalogInput.h | Read analog voltage inputs (0-5V) |
AnalogOutput | frc/AnalogOutput.h | Generate analog voltage outputs |
AnalogEncoder | frc/AnalogEncoder.h | Analog absolute encoder support |
AnalogPotentiometer | frc/AnalogPotentiometer.h | Potentiometer input with scaling |
AnalogTrigger | frc/AnalogTrigger.h | Trigger actions based on analog thresholds |
Motor Controllers
| Class | Header | Description |
|---|---|---|
PWMSparkMax | frc/motorcontrol/PWMSparkMax.h | Control REV Robotics SPARK MAX |
PWMTalonSRX | frc/motorcontrol/PWMTalonSRX.h | Control CTRE Talon SRX |
PWMVictorSPX | frc/motorcontrol/PWMVictorSPX.h | Control CTRE Victor SPX |
Spark | frc/motorcontrol/Spark.h | Generic SPARK controller |
Pneumatics
| Class | Header | Description |
|---|---|---|
Compressor | frc/Compressor.h | Control pneumatic compressor |
Solenoid | frc/Solenoid.h | Single solenoid valve control |
DoubleSolenoid | frc/DoubleSolenoid.h | Double solenoid valve control |
Sensors
Gyroscopes
ADIS16448_IMU- Analog Devices IMUADIS16470_IMU- Analog Devices IMUADXRS450_Gyro- Analog Devices SPI gyroAnalogGyro- Analog gyroscope
Accelerometers
ADXL345_I2C- I2C accelerometerADXL345_SPI- SPI accelerometerADXL362- SPI accelerometerBuiltInAccelerometer- roboRIO accelerometer
TimedRobot
TheTimedRobot class provides a framework where methods are called periodically at a fixed rate.
Example Usage
DriverStation
Provides access to driver station data and FMS information.AddressableLED
Control addressable RGB LED strips.Units Library Integration
WPILibC uses theunits library for type-safe physical quantities.
Filesystem
Access robot filesystem paths.Smart Pointers and RAII
WPILibC uses RAII principles and smart pointers for automatic resource management.Error Handling
WPILibC uses exceptions for error handling.Data Logging
| Class | Header | Description |
|---|---|---|
DataLogManager | frc/DataLogManager.h | Manage robot data logging |
Alert | frc/Alert.h | Create and manage robot alerts |
Utility Classes
| Class | Header | Description |
|---|---|---|
Timer | frc/Timer.h | Timing and delay utilities |
Watchdog | frc/Watchdog.h | Monitor loop timing |
Notifier | frc/Notifier.h | Schedule callbacks |
EventLoop | frc/event/EventLoop.h | Event-driven programming |
Source Code
View the full source code on GitHub:Related Documentation
WPILibJ API
Java implementation of WPILib
Command Framework
Command-based programming framework
HAL API
Hardware Abstraction Layer
WPIMath
Mathematics and control libraries