I’m using the rev color sensor v3 this year and am struggling with it a tad. I’ve noticed in the video, REV was able to display the color in the smart dashboard. My sensor doesn’t even seem to be able to detect the colors. It displays a small decimal instead of numbers. As for it telling me what color it is, would I use color match?
public class WheelOfPain extends SubsystemBase {
private final VictorSPX m_wheelOfFortune;
private final I2C.Port sensorPort;
private final ColorSensorV3 colorSensor;
private final Color currentColor;
private final int rawIr;
public WheelOfPain() {
sensorPort = I2C.Port.kOnboard;
colorSensor = new ColorSensorV3(sensorPort);
currentColor = colorSensor.getColor();
rawIr = colorSensor.getIR();
m_wheelOfFortune = new VictorSPX(Constants.WHEEL_MOTOR);
}
@Override
public void periodic() {
SmartDashboard.putNumber("Red", currentColor.red);
SmartDashboard.putNumber("Blue", currentColor.blue);
SmartDashboard.putNumber("Green", currentColor.green);
SmartDashboard.putNumber("IR", rawIr);
}
}