Skip to content

RGB Indicators

NextRGBIndicator is a wrapper for the goBILDA PWM RGB Indicator Light. The module behaves like a servo, where different PWM positions correspond to different colors and patterns. It extends NextServo, so everything from that class is available too.

// By Lynx Module and port, recommended
val indicator = NextRGBIndicator(RobotController.controlHub, 0)
// Using your configuration name
val indicator = NextRGBIndicator("LED")

Both constructors accept an optional cacheTolerance parameter:

Parameter Type Default Description
cacheTolerance Double 0.01 Minimum change in position required before a new value is written to the indicator.

Sets the indicator to one of the predefined Color values: OFF, RED, ORANGE, YELLOW, SAGE, GREEN, AZURE, BLUE, INDIGO, VIOLET, WHITE.

indicator.setColor(NextRGBIndicator.Color.RED)
indicator.setColor(0.200) // for custom values

Sets the brightness by scaling the PWM range, where 0.0 is dimmest and 1.0 is brightest.

indicator.setBrightness(0.8)