Examples

Use-Case

This example program demonstrates how to use the AndyMark CAN Color Sensor in an FRC robot program. It initializes the sensor over the CAN bus and continuously reads data while the robot is enabled. The program collects proximity/distance information (how close an object is to the sensor), the ambient light level, and individual red, green, and blue color intensity values. These values are then displayed to the SmartDashboard in real time, allowing users to see exactly what the sensor is detecting and how the readings change as objects move closer or lighting conditions vary. This example is useful for quick bring-up and testing, validating CAN wiring and device IDs, understanding the sensor’s output, and troubleshooting sensor placement on a robot, and it can be used without needing in-depth programming knowledge.

Mounting Examples

Code Example

You must first install the AndyMark vendor libraries. Instructions can be found here

View Device API for a comprehensive list of commands

Last updated

Was this helpful?