.. include:: <isonum.txt>

# WPILib Example Projects

.. warning:: While every attempt is made to keep WPILib examples functional, they are *not* intended to be used "as-is."  At the very least, robot-specific constants will need to be changed for the code to work on a user robot.  Many empirical constants have their values "faked" for demonstration purposes.  Users are strongly encouraged to write their own code (from scratch or from an existing template) rather than copy example code.

WPILib example projects demonstrate a large number of library features and use patterns.  Projects range from simple demonstrations of a single functionality to complete, competition-capable robot programs. All of these examples are available in VS Code by entering :kbd:`Ctrl+Shift+P`, then selecting `WPILib: Create a new project` and choosing example.

.. image:: /docs/software/vscode-overview/images/creating-robot-program/create-new-project.png

## Basic Examples

These examples demonstrate basic/minimal robot functionality.  They are useful for beginning teams who are gaining initial familiarity with robot programming, but are highly limited in functionality.

* **Arcade Drive** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/arcadedrive), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/ArcadeDrive), [Python](https://github.com/robotpy/examples/tree/main/ArcadeDrive)): Demonstrates a simple differential drive implementation using "arcade"-style controls through the ``DifferentialDrive`` class.
* **Arcade Drive Xbox Controller** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/arcadedrivexboxcontroller), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/ArcadeDriveXboxController), [Python](https://github.com/robotpy/examples/tree/main/ArcadeDriveXboxController)): Demonstrates the same functionality seen in the previous example, except using an ``XboxController`` instead of an ordinary joystick.
* **Getting Started** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gettingstarted), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/GettingStarted), [Python](https://github.com/robotpy/examples/tree/main/GettingStarted)): Demonstrates a simple autonomous routine that drives forwards for two seconds at half speed.
* **Mecanum Drive** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumdrive), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/MecanumDrive), [Python](https://github.com/robotpy/examples/tree/main/MecanumDrive)): Demonstrates a simple mecanum drive implementation using the ``MecanumDrive`` class.
* **Motor Controller** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/motorcontrol), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/MotorControl), [Python](https://github.com/robotpy/examples/tree/main/MotorControl)): Demonstrates how to control the output of a motor with a joystick with an encoder to read motor position.
* **Simple Vision** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/quickvision), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/QuickVision), [Python](https://github.com/robotpy/examples/tree/main/QuickVision)): Demonstrates how to stream video from a USB camera to the dashboard.
* **Relay** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/relay), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/Relay), [Python](https://github.com/robotpy/examples/tree/main/Relay)): Demonstrates the use of the ``Relay`` class to control a relay output with a set of joystick buttons.
* **Solenoids** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/solenoid), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/Solenoid), [Python](https://github.com/robotpy/examples/tree/main/Solenoid)): Demonstrates the use of the ``Solenoid`` and ``DoubleSolenoid`` classes to control solenoid outputs with a set of joystick buttons.
* **TankDrive** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/tankdrive), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/TankDrive), [Python](https://github.com/robotpy/examples/tree/main/TankDrive)): Demonstrates a simple differential drive implementation using "tank"-style controls through the ``DifferentialDrive`` class.
* **Tank Drive Xbox Controller** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/tankdrivexboxcontroller), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/TankDriveXboxController), [Python](https://github.com/robotpy/examples/tree/main/TankDriveXboxController)): Demonstrates the same functionality seen in the previous example, except using an ``XboxController`` instead of an ordinary joystick.

## Control Examples

These examples demonstrate WPILib implementations of common robot controls.  Sensors may be present, but are not the emphasized concept of these examples.

* **DifferentialDriveBot** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/differentialdrivebot), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot), [Python](https://github.com/robotpy/examples/tree/main/DifferentialDriveBot)): Demonstrates an advanced differential drive implementation, including encoder-and-gyro odometry through the ``DifferentialDriveOdometry`` class, and composition with PID velocity control through the ``DifferentialDriveKinematics`` and ``PIDController`` classes.
* **DifferentialDrivePoseEstimator** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/differentialdriveposeestimator), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator)): Demonstrates an advanced differential drive implementation with all the features of ``DifferentialDriveBot``.  In addition this example uses ``DifferentialDrivePoseEstimator`` to track the robots position on the field.  It demonstrates these features by using WPILib Simulation.
* **Elevator with Profiled PID Controller** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/elevatorprofiledpid), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/ElevatorProfiledPID), [Python](https://github.com/robotpy/examples/tree/main/ElevatorProfiledPID)): Demonstrates the use of the ``ProfiledPIDController`` class to control the position of an elevator mechanism.
* **Elevator with Trapezoid Profiled PID** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/elevatortrapezoidprofile), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/ElevatorTrapezoidProfile), [Python](https://github.com/robotpy/examples/tree/main/ElevatorTrapezoidProfile)): Demonstrates the use of the ``TrapezoidProfile`` class in conjunction with a "smart motor controller" to control the position of an elevator mechanism.
* **Elevator with Exponential Profiled PID** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/elevatorexponentialprofile), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialProfile)): Demonstrates the use of the ``ExponentialProfile`` class in conjunction with a "smart motor controller" to control the position of an elevator mechanism.
* **Flywheel Bang-Bang Controller** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/flywheelbangbangcontroller), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/FlywheelBangBangController/cpp), [Python](https://github.com/robotpy/examples/tree/main/FlywheelBangBangController)): Uses the ``BangBangController`` class to simply yet effectively control a flywheel.
* **Gyro Mecanum** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gyromecanum), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/GyroMecanum), [Python](https://github.com/robotpy/examples/tree/main/GyroMecanum)): Demonstrates field-oriented control of a mecanum robot through the ``MecanumDrive`` class in conjunction with a gyro.
* **MecanumBot** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumbot), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/MecanumBot), [Python](https://github.com/robotpy/examples/tree/main/MecanumBot)): Demonstrates an advanced mecanum drive implementation, including encoder-and-gyro odometry through the ``MecanumDriveOdometry`` class, and composition with PID velocity control through the ``MecanumDriveKinematics`` and ``PIDController`` classes.
* **Mecanum Drive PoseEstimator** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumdriveposeestimator), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator)): Demonstrates an advanced mecanum drive implementation with all the features of ``MecanumBot``.  In addition this example uses ``MecanumDrivePoseEstimator`` to track the robots position on the field.
* **PotentiometerPID** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/potentiometerpid), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/PotentiometerPID), [Python](https://github.com/robotpy/examples/tree/main/PotentiometerPID)): Demonstrates the use of the ``PIDController`` class and a potentiometer to control the position of an elevator mechanism.
* **SwerveBot** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervebot), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/SwerveBot), [Python](https://github.com/robotpy/examples/tree/main/SwerveBot)): Demonstrates an advanced swerve drive implementation, including encoder-and-gyro odometry through the ``SwerveDriveOdometry`` class, and composition with PID position and velocity control through the ``SwerveDriveKinematics`` and ``PIDController`` classes.
* **Swerve Drive PoseEstimator** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervedriveposeestimator), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator)): Demonstrates an advanced swerve drive implementation with all the features of ``SwerveBot``.  In addition this example uses ``SwerveDrivePoseEstimator`` to track the robots position on the field.
* **UltrasonicPID** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonicpid), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/UltrasonicPID), [Python](https://github.com/robotpy/examples/tree/main/UltrasonicPID)): Demonstrates the use of the ``PIDController`` class in conjunction with an ultrasonic sensor to drive to a set distance from an object.

## Sensor Examples

These examples demonstrate sensor reading and data processing using WPILib.  Mechanisms control may be present, but is not the emphasized concept of these examples.

* **HTTP Camera** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/httpcamera), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/HttpCamera)): Demonstrates the use of OpenCV and a HTTP Camera to overlay a rectangle on a captured video feed and stream it to the dashboard.
* **Power Distribution CAN Monitoring** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/canpdp), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/CANPDP), [Python](https://github.com/robotpy/examples/tree/main/CANPDP)): Demonstrates obtaining sensor information from a Power Distribution module over CAN using the ``PowerDistribution`` class.
* **Duty Cycle Encoder** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/dutycycleencoder), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/DutyCycleEncoder), [Python](https://github.com/robotpy/examples/tree/main/DutyCycleEncoder)): Demonstrates the use of the ``DutyCycleEncoder`` class to read values from a PWM-type absolute encoder.
* **DutyCycleInput** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/dutycycleinput), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/DutyCycleInput), [Python](https://github.com/robotpy/examples/tree/main/DutyCycleInput)): Demonstrates the use of the ``DutyCycleInput`` class to read the frequency and fractional duty cycle of a :term:`PWM` input.
* **Encoder** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/encoder), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/Encoder), [Python](https://github.com/robotpy/examples/tree/main/Encoder)): Demonstrates the use of the ``Encoder`` class to read values from a quadrature encoder.
* **Gyro** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gyro), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/Gyro), [Python](https://github.com/robotpy/examples/tree/main/Gyro)): Demonstrates the use of the ``AnalogGyro`` class to measure robot heading and stabilize driving.
* **Intermediate Vision** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/intermediatevision), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/IntermediateVision), [Python](https://github.com/robotpy/examples/tree/main/IntermediateVision)): Demonstrates the use of OpenCV and a USB camera to overlay a rectangle on a captured video feed and stream it to the dashboard.
* **AprilTagsVision** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/apriltagsvision), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/AprilTagsVision), [Python](https://github.com/robotpy/examples/tree/main/AprilTagsVision)): Demonstrates on-roboRIO detection of AprilTags using an attached USB camera.
* **Ultrasonic** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonic), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/Ultrasonic), [Python](https://github.com/robotpy/examples/tree/main/Ultrasonic)): Demonstrates the use of the ``Ultrasonic`` class to read data from an ultrasonic sensor in conjunction with the ``MedianFilter`` class to reduce signal noise.
* **SysIdRoutine** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/sysidroutine), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/SysIdRoutine), [Python](https://github.com/robotpy/examples/tree/main/SysId)): Demonstrates the use of the SysIdRoutine API to gather characterization data for a differential drivetrain.

## Command-Based Examples

These examples demonstrate the use of the :ref:`Command-Based framework <docs/software/commandbased/what-is-command-based:What Is "Command-Based" Programming?>`.

* **DriveDistanceOffboard** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/drivedistanceoffboard), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard), [Python](https://github.com/robotpy/examples/tree/main/DriveDistanceOffboard)): Demonstrates the use of a ``TrapezoidProfileCommand`` in conjunction with a "smart motor controller" to drive forward by a set distance with a trapezoidal motion profile.
* **Rapid React Command Bot** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/rapidreactcommandbot), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot)): This project uses the latest command based best practices and the Epilogue logging system.  It is capable of playing the FRC 2022 game Rapid React.
* **Inlined Hatchbot** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbotinlined), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/HatchbotInlined), [Python](https://github.com/robotpy/examples/tree/main/HatchbotInlined)): A complete set of robot code for a simple hatch-delivery bot typical of the 2019 FRC game *Destination: Deep Space*.  Commands are written in an "inline" style, in which explicit subclassing of ``Command`` is avoided.
* **Traditional Hatchbot** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbottraditional), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional), [Python](https://github.com/robotpy/examples/tree/main/HatchbotTraditional)): A complete set of robot code for a simple hatch-delivery bot typical of the 2019 FRC game *Destination: Deep Space*.  Commands are written in a "traditional" style, in which subclasses of ``Command`` are written for each robot action.
* **MecanumControllerCommand** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumcontrollercommand), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/MecanumControllerCommand)): Demonstrates trajectory generation and following with a mecanum drive using the ``TrajectoryGenerator`` and ``MecanumControllerCommand`` classes.
* **Select Command Example** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/selectcommand), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/SelectCommand), [Python](https://github.com/robotpy/examples/tree/main/SelectCommand)): Demonstrates the use of the ``SelectCommand`` class to run one of a selection of commands depending on a runtime-evaluated condition.
* **SwerveControllerCommand** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/SwerveControllerCommand)): Demonstrates trajectory generation and following with a swerve drive using the ``TrajectoryGenerator`` and ``SwerveControllerCommand`` classes.

## State-Space Examples

These examples demonstrate the use of the :ref:`State-Space Control <docs/software/advanced-controls/state-space/state-space-intro:Introduction to State-Space Control>`.

* **StateSpaceFlywheel** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/statespaceflywheel), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheel), [Python](https://github.com/robotpy/examples/tree/main/StateSpaceFlywheel)): Demonstrates state-space control of a flywheel.
* **StateSpaceFlywheelSysId** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/statespaceflywheelsysid), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheelSysId), [Python](https://github.com/robotpy/examples/tree/main/StateSpaceFlywheelSysId)): Demonstrates state-space control using SysId's System Identification for controlling a flywheel.
* **StateSpaceElevator** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/statespaceelevator), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/StateSpaceElevator), [Python](https://github.com/robotpy/examples/tree/main/StateSpaceElevator)): Demonstrates state-space control of an elevator.
* **StateSpaceArm** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/statespacearm), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/StateSpaceArm), [Python](https://github.com/robotpy/examples/tree/main/StateSpaceArm)): Demonstrates state-space control of an Arm.

## Simulation Physics Examples

These examples demonstrate the use of the physics simulation.

* **ElevatorSimulation** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/elevatorsimulation), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation), [Python](https://github.com/robotpy/examples/tree/main/ElevatorSimulation)): Demonstrates the use of physics simulation with a simple elevator.
* **ElevatorSimulation with Exponential PID** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/elevatorexponentialsimulation), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation)): Demonstrates the use of physics simulation of an elevator being controlled with exponential profiled PID.
* **ArmSimulation** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/armsimulation), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/ArmSimulation), [Python](https://github.com/robotpy/examples/tree/main/ArmSimulation)): Demonstrates the use of physics simulation with a simple single-jointed arm.
* **SimpleDifferentialDriveSimulation** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/simpledifferentialdrivesimulation), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation)): A barebones example of a basic drivetrain that can be used in simulation.

## Miscellaneous Examples

These examples demonstrate miscellaneous WPILib functionality that does not fit into any of the above categories.

* **Addressable LED** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/addressableled), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/AddressableLED), [Python](https://github.com/robotpy/examples/tree/main/AddressableLED)): Demonstrates the use of the ``AddressableLED`` class to control RGB LEDs for robot decoration and/or driver feedback.
* **Digital Communication** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/digitalcommunication), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/DigitalCommunication), [Python](https://github.com/robotpy/examples/tree/main/DigitalCommunication)): This is a sample program demonstrating how to communicate to a light controller from the robot code using the roboRIO's DIO ports.
* **I2C Communication** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/i2ccommunication), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/I2CCommunication), [Python](https://github.com/robotpy/examples/tree/main/I2CCommunication)): This is a sample program demonstrating how to communicate to a light controller from the robot code using the roboRIO's I2C port.
* **DMA** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/dma/), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/DMA)): Demonstrates the use of DMA (Direct Memory Access) to read from sensors without using the RoboRIO's CPU.
* **HAL** ([C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/HAL)): Demonstrates the use of HAL (Hardware Abstraction Layer) without the use of the rest of WPILib. This example is for advanced users (C++ only).
* **HID Rumble** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hidrumble), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/HidRumble), [Python](https://github.com/robotpy/examples/tree/main/HidRumble)): Demonstrates the use of the "rumble" functionality for tactile feedback on supported HIDs (such as XboxControllers).
* **Shuffleboard** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/shuffleboard), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/ShuffleBoard), [Python](https://github.com/robotpy/examples/tree/main/ShuffleBoard)): Demonstrates configuring tab/widget layouts on the "Shuffleboard" dashboard from robot code through the ``Shuffleboard`` class's fluent builder API.
* **RomiReference** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/romireference), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/RomiReference), [Python](https://github.com/robotpy/examples/tree/main/RomiReference)): A command based example of how to run the :doc:`Romi robot </docs/romi-robot/index>`.
* **XRPReference** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/xrpreference), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/XRPReference)): A command based example of how to run the :doc:`XRP robot </docs/xrp-robot/index>`.
* **Mechanism2d** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mechanism2d), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/Mechanism2d), [Python](https://github.com/robotpy/examples/tree/main/Mechanism2d)): A simple example of using :doc:`Mechanism2d </docs/software/dashboards/glass/mech2d-widget>`.
* **EventLoop** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/eventloop), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/EventLoop/cpp)): Demonstrates the use of the ``EventLoop`` class that allows code to be called based on a boolean condition in the event-driven programming style.
* **UnitTest** ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/unittest), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/main/cpp/examples/UnitTest)): Shows how to do :doc:`Unit Testing </docs/software/wpilib-tools/robot-simulation/unit-testing>`.  The test files need to be in a separate Test directory ([Java](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibjExamples/src/test/java/edu/wpi/first/wpilibj/examples/unittest), [C++](https://github.com/wpilibsuite/allwpilib/tree/v2026.2.1/wpilibcExamples/src/test/cpp/examples/UnitTest/cpp)).
