Getting Started with C++
Examples for getting started with FRC C++
CommandBased Robot
Examples for CommandBased robot programs.
Actuators
Example programs that demonstrate the use of various actuators
Analog
Examples programs that show different uses of analog inputs,
outputs and various analog sensors
CAN
Example programs that demonstrate the use of the CAN components in the control
system
Complete List
Complete list of all sample programs across all categories
Digital
Example programs that demonstrate the sensors that use the digital I/O ports
I2C
Example programs that demonstrate the use of I2C and various sensors that use
it
Joystick
Example programs that demonstate different uses of joysticks for robot
driving
Pneumatics
Example programs that demonstrate the use of the compressor and solenoids
Robot and Motor
Example programs that demonstrate driving a robot and motors including safety,
servos, etc.
SPI
Example programs that demonstrate the use of the SPI bus and sensors that
connect to it
Safety
Example programs that demonstate the motor safety classes and how to use them
with your programs
Sensors
Example programs that demonstrate the use of the various commonly used sensors
on FRC robots
Vision
Example programs that demonstrate the use of a camera for image acquisition and
processing
Motor Controller
Demonstrate controlling a single motor with a Joystick.
Robot and Motor
Actuators
Joystick
Complete List
src
Motor Control With Encoder
Demonstrate controlling a single motor with a Joystick and displaying the net
movement of the motor using an encoder.
Robot and Motor
Digital
Sensors
Actuators
Joystick
Complete List
src
Relay
Demonstrate controlling a Relay from Joystick buttons.
Actuators
Joystick
Complete List
src
PDP CAN Monitoring
Demonstrate using CAN to monitor the voltage, current, and temperature in the
Power Distribution Panel.
Complete List
CAN
Sensors
src
Solenoids
Demonstrate controlling a single and double solenoid from Joystick buttons.
Actuators
Joystick
Pneumatics
Complete List
src
Encoder
Demonstrate displaying the value of a quadrature encoder on the
SmartDashboard.
Complete List
Digital
Sensors
src
Arcade Drive
An example program which demonstrates the use of Arcade Drive with the DifferentialDrive class
Getting Started with C++
Robot and Motor
Joystick
Complete List
src
Mecanum Drive
An example program which demonstrates the use of Mecanum Drive with the MecanumDrive class
Getting Started with C++
Robot and Motor
Joystick
Complete List
src
Ultrasonic
Demonstrate maintaining a set distance using an ultrasonic sensor.
Robot and Motor
Complete List
Sensors
Analog
src
UltrasonicPID
Demonstrate maintaining a set distance using an ultrasonic sensor and PID
control.
Robot and Motor
Complete List
Sensors
Analog
src
Gyro
An example program showing how to drive straight with using a gyro sensor.
Robot and Motor
Complete List
Sensors
Analog
Joystick
src
Gyro Mecanum
An example program showing how to perform mecanum drive with field oriented
controls.
Robot and Motor
Complete List
Sensors
Analog
Joysitck
src
PotentiometerPID
An example to demonstrate the use of a potentiometer and PID control to reach
elevator position setpoints.
Joystick
Actuators
Complete List
Sensors
Analog
src
Getting Started
An example program which demonstrates the simplest autonomous and
teleoperated routines.
Getting Started with C++
Complete List
src
Simple Vision
The minimal program to acquire images from an attached USB camera on the robot
and send them to the dashboard.
Vision
Complete List
src
Intermediate Vision
An example program that acquires images from an attached USB camera and adds
some
annotation to the image as you might do for showing operators the result of some image
recognition, and sends it to the dashboard for display.
Vision
Complete List
src
Axis Camera Sample
An example program that acquires images from an Axis network camera and adds
some
annotation to the image as you might do for showing operators the result of some image
recognition, and sends it to the dashboard for display. This demonstrates the use of the
AxisCamera class.
Vision
Complete List
src
GearsBot
A fully functional example CommandBased program for
WPIs GearsBot robot. This code can run on your computer if it
supports simulation.
CommandBased Robot
Complete List
/usr/share/frcsim/worlds/GearsBotDemo.world
src
src/Commands
src/Subsystems
PacGoat
A fully functional example CommandBased program for FRC Team 190's 2014
robot. This code can run on your computer if it supports simulation.
CommandBased Robot
Complete List
/usr/share/frcsim/worlds/PacGoat2014.world
src
src/Commands
src/Subsystems
src/Triggers