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.
Creating a NextRGBIndicator
Section titled “Creating a NextRGBIndicator”// By Lynx Module and port, recommendedval indicator = NextRGBIndicator(RobotController.controlHub, 0)
// Using your configuration nameval indicator = NextRGBIndicator("LED")// By Lynx Module and port, recommendedNextRGBIndicator indicator = new NextRGBIndicator(RobotController.controlHub(), 0);
// Using your configuration nameNextRGBIndicator indicator = new 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. |
setColor(color)
Section titled “setColor(color)”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 valuesindicator.setColor(NextRGBIndicator.Color.RED);indicator.setColor(0.200); // for custom valuessetBrightness(brightness)
Section titled “setBrightness(brightness)”Sets the brightness by scaling the PWM range, where 0.0 is dimmest and 1.0 is brightest.
indicator.setBrightness(0.8)indicator.setBrightness(0.8);
