Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
WPILib Documentation documentation
WPILib Documentation
Logo?
latest

Zero to Robot

  • Introduction
  • Step 1: Building your Robot
    • Introduction to FRC Robot Wiring
  • Step 2: Installing Software
    • Offline Installation Preparation
    • Installing the FIRST Driver Station
    • WPILib Installation Guide
    • Python Installation Guide
    • Next Steps
  • Step 3: Preparing Your Robot
    • Imaging your Systemcore
    • Programming your Radio
    • Using the OpenMesh OM5P Radio
  • Step 4: Programming your Robot
    • Creating your Test Drivetrain Program (Java/C++/Python)
    • Running your Test Program

Control System Overviews

  • Hardware Component Overview
  • Software Component Overview

Programming Basics

  • What is WPILib?
  • 2027 Overview
    • Known Issues
    • New for 2027
    • Quick Start for Returning Teams
    • 2026 Game Data Details
    • Removed features
  • VS Code Overview
    • Visual Studio Code Basics and the WPILib Extension
    • WPILib Commands in Visual Studio Code
    • Creating a Robot Program
    • 3rd Party Libraries
    • Building and Deploying Robot Code
    • Viewing Console Output
    • Debugging a Robot Program
    • Importing Last Year’s Robot Code
  • Dashboards
    • Choosing a Dashboard
    • Glass
      • Introduction to Glass
      • Establishing NetworkTables Connections
      • Glass Widgets
      • Widgets for the Command-Based Framework
      • The Field2d Widget
      • The Mechanism2d Widget
      • Plots
    • AdvantageScope
    • Elastic
    • Troubleshooting Dashboard Connectivity
  • Telemetry
    • Telemetry: Recording and Sending Real-Time Data
    • New for 2025: Robot Telemetry with Annotations (Java Only)
    • Recording Faults with Persistent Alerts
    • On-Robot Telemetry Recording Into Data Logs
    • Downloading & Processing Data Logs
    • Third-Party Telemetry Libraries
  • RobotPy Python Programming
    • Python Installation Guide
    • Installing the FIRST Driver Station
    • pyproject.toml usage
    • RobotPy subcommands
      • Deploy Python program to roboRIO
  • Hardware APIs
    • Motors APIs
      • Using Motor Controllers in Code
      • PWM Motor Controllers in Depth
      • Using the WPILib Classes to Drive your Robot
      • Repeatable Low Power Movement - Controlling Servos with WPILib
    • Pneumatics APIs
      • Operating Pneumatic Cylinders
      • Generating and Storing Pressure
    • Sensors
      • Sensor Overview - Software
      • Accelerometers - Software
      • Gyroscopes - Software
      • Encoders - Software
      • Analog Inputs - Software
      • Analog Potentiometers - Software
      • Digital Inputs - Software
      • Programming Limit Switches
    • Miscellaneous Hardware APIs
      • Addressable LEDs
  • CAN Devices
    • Using CAN Devices
    • Pneumatics Control Module
    • Pneumatic Hub
    • Power Distribution Module
    • Third-Party CAN Devices
    • FIRST CAN Device Specifications
  • Basic Programming
    • Git Version Control Introduction
    • The C++ Units Library
    • The Java Units Library
    • Joysticks
    • Coordinate System
    • Setting Robot Preferences
    • Robot Project Deploy Directory
    • Reading Stacktraces
    • Treating Functions as Data
    • Get Alliance Color
    • Java Garbage Collection
    • Using Utility Mode
  • Support Resources
  • FRC Glossary

API Docs

  • WPILib Java API Docs
  • WPILib C++ API Docs
  • WPILib Python API Docs

Software Tools

  • Driver Station
    • FRC Driver Station Powered by NI LabVIEW
    • Driver Station (Operator Console) Best Practices
    • Driver Station Log File Viewer
    • Driver Station Errors/Warnings
    • Driver Station Timing Viewer
    • Manually Setting the Driver Station to Start Custom Dashboard
  • Robot Simulation
    • Introduction to Robot Simulation
    • Simulation Specific User Interface Elements
    • Glass Widgets
    • Widgets for the Command-Based Framework
    • The Field2d Widget
    • Plots
    • Physics Simulation with WPILib
    • Device Simulation
    • Drivetrain Simulation Tutorial
      • Drivetrain Simulation Overview
      • Step 1: Creating Simulated Instances of Hardware
      • Step 2: Creating a Drivetrain Model
      • Step 3: Updating the Drivetrain Model
      • Step 4: Updating Odometry and Visualizing Robot Position
    • Unit Testing
  • OutlineViewer
  • WPIcal

Advanced Programming

  • Vision Processing
    • Vision Introduction
      • What is Vision?
      • Strategies for Vision Programming
      • Identifying and Processing the Targets
      • Read and Process Video: CameraServer Class
    • Vision with WPILibPi
      • A Video Walkthrough of using WPILibPi with the Raspberry Pi
      • Using a Coprocessor for vision processing
      • Using the Raspberry Pi for FRC
      • What you need to get the Pi image running
      • Installing the image to your MicroSD card
      • The Raspberry PI
      • Using CameraServer
      • Thresholding an Image
      • Morphological Operations
      • Working with Contours
      • Basic Vision Example
    • AprilTag Introduction
      • What Are AprilTags?
    • Vision on the RoboRIO
      • Using the CameraServer on the roboRIO
      • Using Multiple Cameras
      • CameraServer Web Interface
  • Command-Based Programming
    • Commands v2 Programming
      • What Is “Command-Based” Programming?
      • Commands
      • Command Compositions
      • Subsystems
      • Binding Commands to Triggers
      • Structuring a Command-Based Robot Project
      • Organizing Command-Based Robot Projects
      • The Command Scheduler
      • A Technical Discussion on C++ Commands
      • PID Control in Command-based
      • Motion Profiling in Command-based
      • Combining Motion Profiling and PID in Command-Based
  • Kinematics and Odometry
    • Introduction to Kinematics and The ChassisSpeeds Class
    • Differential Drive Kinematics
    • Differential Drive Odometry
    • Swerve Drive Kinematics
    • Swerve Drive Odometry
    • Mecanum Drive Kinematics
    • Mecanum Drive Odometry
  • NetworkTables
    • What is NetworkTables
    • NetworkTables Tables and Topics
    • Publishing and Subscribing to a Topic
    • NetworkTables Instances
    • NetworkTables Networking
    • Listening for Changes
    • Writing a Simple NetworkTables Robot Program
    • Creating a Client-side Program
    • Migrating from NetworkTables 3.0 to NetworkTables 4.0
    • Reading Array Values Published by NetworkTables
  • Path Planning
    • Choreo
  • Systemcore
    • Systemcore Introduction
    • Imaging your Systemcore
    • Systemcore Web Dashboard
    • roboRIO FTP
    • roboRIO User Accounts and SSH
    • roboRIO Brownout and Understanding Current Draw
  • Advanced GradleRIO
    • Using External Libraries with Robot Code
    • Setting up CI for Robot Code using GitHub Actions
    • Using a Code Formatter
    • Gradlew Tasks
    • Including Git Data in Deploy
    • Using Compiler Arguments
    • Profiling with VisualVM
    • JVM Runtime error
  • Advanced Controls
    • A Video Walkthrough of Model Based Validation of Autonomous in FRC
    • Advanced Controls Introduction
      • Control System Basics
      • Picking a Control Strategy
      • Introduction to DC Motor Feedforward
      • Introduction to PID
      • PID Introduction Video by WPI
      • Introduction To Controls Tuning Tutorials
      • Tuning a Flywheel Velocity Controller
      • Tuning a Turret Position Controller
      • Tuning a Vertical Arm Position Controller
      • Tuning a Vertical Elevator with Motion Profiling
      • Common Control Loop Tuning Issues
    • Filters
      • Introduction to Filters
      • Linear Filters
      • Median Filter
      • Slew Rate Limiter
      • Debouncer
    • Geometry Classes
      • Translation, Rotation, and Pose
      • Transformations
    • System Identification
      • Introduction to System Identification
      • Creating an Identification Routine
      • Running the Identification Routine
      • Loading Data
      • Viewing Diagnostics
      • Analyzing Data
      • Additional Utilities and Tools
    • Controllers
      • PID Control in WPILib
      • Feedforward Control in WPILib
      • Combining Feedforward and PID Control
      • Trapezoidal Motion Profiles in WPILib
      • Combining Motion Profiling and PID Control with ProfiledPIDController
      • Bang-Bang Control with BangBangController
    • Trajectory Generation and Following with WPILib
      • Trajectory Generation
      • Trajectory Constraints
      • Manipulating Trajectories
      • Transforming Trajectories
      • LTV Unicycle Controller
      • Troubleshooting
    • State-Space and Model Based Control with WPILib
      • Introduction to State-Space Control
      • State-Space Controller Walkthrough
      • State Observers and Kalman Filters
      • Pose Estimators
      • Debugging State-Space Models and Controllers
    • Controls Glossary
  • Convenience Features
    • Scheduling Functions at Custom Frequencies
    • Event-Based Programming With EventLoop

Examples and Tutorials

  • WPILib Example Projects
  • Third Party Example Projects

Hardware

  • Hardware - Basics
    • Hardware Component Overview
    • Introduction to FRC Robot Wiring
    • Wiring Best Practices
    • CAN Wiring Basics
    • Wiring Pneumatics - CTRE Pneumatic Control Module
    • Wiring Pneumatics - REV Pneumatic Hub
    • Status Light Quick Reference
    • Robot Preemptive Troubleshooting
    • Robot Battery Basics
  • Hardware Tutorials
    • Motors for Robotics Applications
    • Sensing and Sensors
    • Pneumatics
    • Power Transmission
  • Sensors
    • Sensor Overview - Hardware
    • Analog Inputs - Hardware
    • Analog Potentiometers - Hardware
    • Digital Inputs - Hardware
    • Proximity Switches - Hardware
    • Encoders - Hardware
    • Gyroscopes - Hardware
    • Accelerometers - Hardware
    • LIDAR - Hardware
    • Triangulating Rangefinders
    • Serial Buses

Romi and XRP Support

  • Getting Started with Romi
    • Romi Hardware & Assembly
    • Imaging your Romi
    • Getting to know your Romi
    • Romi Hardware Support
    • The Romi Web UI
    • Programming the Romi
  • Getting Started with XRP
    • XRP Hardware, Assembly, and Imaging
    • Getting to know your XRP
    • XRP Hardware Support
    • The XRP Web UI
    • Programming the XRP

Robot Networking

  • Networking Introduction
    • Networking Basics
    • IP Configurations
    • Systemcore Network Troubleshooting
    • Windows Firewall Configuration
    • Measuring Bandwidth Usage
  • Networking Utilities
    • Port Forwarding

Contributing

  • Contributing to wpilib-docs
    • Contribution Guidelines
    • Style Guide
    • Build Instructions
    • Draw.io Saving Instructions
    • Translations
    • Top Contributors
    • Top Translators
    • TODO List
  • Developing with allwpilib
    • Overview
    • Styleguide & wpiformat
    • Building with CMake
    • Using Development Builds
    • Maven Artifacts
    • Contributor Guidelines
    • NetworkTables 4 Protocol Spec

Legal

  • Privacy Policy

Issues

  • Report a Documentation Issue
Back to top
View this page
Edit this page

Sensors¶

Sensors are an integral way of having your robot hardware and software communicate with each other. This section highlights interfacing with those sensors at a software level.

  • Sensor Overview - Software
  • Accelerometers - Software
  • Gyroscopes - Software
  • Encoders - Software
  • Analog Inputs - Software
  • Analog Potentiometers - Software
  • Digital Inputs - Software
  • Programming Limit Switches
Next
Sensor Overview - Software
Previous
Generating and Storing Pressure
Copyright © 2026, FIRST and other WPILib Contributors. This work is licensed under a Creative Commons Attribution 4.0 International License
Made with Sphinx and @pradyunsg's Furo
Last updated on Jun 25, 2025