Gray Matter
WorkshopWorkshop Overview
WPILib 2027 is still in alpha: these pages change as the APIs settle.
LESSON 01

Workshop Overview

This site is a written version of Team 5712's programming workshops. It starts with a simple mechanism, a flywheel or an arm, and works up to a swerve drive. To keep things simple, it covers CTRE mechanisms and swerve drives only.

4 minutes
You’ll need

Nothing here assumes you have written code before. It does assume you have a mechanism to run.

Team 5712, Hemlock's Gray Matter, wrote this workshop and still teaches it in a room. These pages are the same material in the same order, so a team can work through it without us.

Required hardware

There is no software-only path through this workshop. Later lessons talk about running your code in "hardware simulation," and the phrase misleads people. Your laptop stands in for the robot controller. The motors are real, the CAN bus is real, and the arm on the bench is the arm that moves.

This workshop is written for those exact devices, and there are no alternative instructions for other motor controllers. If you have different hardware in your shop, you can still learn the concepts, but the code examples will not work out of the box.

The 2027 stack

For the 2027 season, WPILib introduced Commands v3, a new programming style which changes how you write code. We’re going over Commands v3 in this workshop, not the old system. When you move to a robot, use a SystemCore. A roboRIO cannot run Commands v3.

Library
WPILib 2027 alpha
Commands v3 and OpModes. Each robot mode is its own class, and each mechanism hands out the commands that drive it.
Language
Java 25
Packages start with org.wpilib. An example that says edu.wpi.first was written for an older year.
Controller
SystemCore
The board your code deploys to. Setup instructions written for a roboRIO do not apply.
Vendor
Phoenix 6 alpha
CTRE's library. It drives every motor and sensor you touch.
Watch out

v2 and v3 don't mix

Many FRC tutorials are written for Commands v2. Commands v2 and Commands v3 cannot be mixed in one project.

The road ahead

Read the pages in order. The workshops build on each other, and each one assumes the hardware or the code from the one before it.

Check your work

You won't be running any code on this page, but you will need to gather a few things before moving forward. Make sure you have everything in the list below.

  1. A mechanism on a bench, powered, with plenty of room to run.
  2. A laptop you are allowed to install software on.
Check

You are ready when

Both lines above are true, and the hardware is in front of you rather than on a purchase order.

Next is Prerequisites, which is every download and account you need before the hardware gets plugged in.