Getting Started with Java
Examples for getting started with FRC Java
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
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
NetworkTables
Examples of how to use NetworkTables to accomplish a
variety of tasks such as sending and receiving values to both
dashboards and co-processors.
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.
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
SPI
Example programs that demonstrate the use of the SPI bus and sensors that
connect to it
Vision
Example programs that demonstrate the use of cameras and image processing
Complete Robot
Complete Robot example programs
Getting Started
An example program which demonstrates the simplest autonomous and
teleoperated routines.
Getting Started with Java
src/$package-dir
Tank Drive
Demonstrate the use of the RobotDrive class doing teleop driving with tank
steering
Actuators
Joystick
Robot and Motor
Safety
src/$package-dir
Mecanum Drive
Demonstrate the use of the RobotDrive class doing teleop driving with Mecanum
steering
Actuators
Joystick
Robot and Motor
Safety
src/$package-dir
Ultrasonic
Demonstrate maintaining a set distance using an ultrasonic sensor.
Sensors
Robot and Motor
Analog
src/$package-dir
Ultrasonic PID
Demonstrate maintaining a set distance using an ultrasonic sensor and PID
Control.
Sensors
Robot and Motor
Analog
src/$package-dir
Potentiometer PID
An example to demonstrate the use of a potentiometer and PID control to reach
elevator position setpoints.
Sensors
Actuators
Analog
Joystick
src/$package-dir
Gyro
An example program showing how to drive straight with using a gyro sensor.
Sensors
Robot and Motor
Analog
Joystick
src/$package-dir
Gyro Mecanum
An example program showing how to perform mecanum drive with field oriented
controls.
Sensors
Robot and Motor
Analog
Joystick
src/$package-dir
Motor Controller
Demonstrate controlling a single motor with a joystick
Actuators
Joystick
Robot and Motor
src/$package-dir
GearsBot
A fully functional example CommandBased program for WPIs GearsBot robot. This
code can run on your computer if it supports simulation.
Complete Robot
/usr/share/frcsim/worlds/GearsBotDemo.world
src/$package-dir
src/$package-dir/commands
src/$package-dir/subsystems
Simple Vision
Demonstrate the use of the CameraServer class to stream from a USB Webcam
without processing the images.
Vision
Complete List
src/$package-dir
Intermediate Vision
Demonstrate the use of the NIVision class to capture image from a Webcam,
process them, and then send them to the dashboard.
Vision
Complete List
src/$package-dir
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
src/$package-dir