Examples
Use case
This example reads raw red, green, blue, clear, and proximity values from the CAN Color Sensor and publishes them to SmartDashboard. It also shows how to enable the onboard LED and safely normalize the color channels.
Mounting example
Setup
Install the AndyMark WPILib vendor library before using these examples. LED control requires device firmware 1.1.1 or newer and AmLib 2026.0.2 or newer. See Device API for all available methods.
Validation steps
Record raw values with no target present.
Record each target at the actual operating distance and angle.
Repeat with the robot’s normal illumination and surrounding structure installed.
Test under practice and event lighting.
Choose thresholds from measured separation between targets and include margin for noise.
Last updated
Was this helpful?

