NextRGBIndicator

Wrapper for the goBILDA PWM RGB Indicator Light.

The module behaves like a servo, different PWM positions correspond to different colors/patterns.

Example:

val indicator = NextRGBIndicator("LED")

indicator.setColor(NextRGBIndicator.Color.RED)

indicator.setBrightness(0.8)

Constructors

Link copied to clipboard
constructor(module: NextLynxModule, port: Int, cacheTolerance: Double = 0.01)
constructor(name: String, cacheTolerance: Double = 0.01)

Types

Link copied to clipboard

Available colors/patterns for the headlights

Properties

Link copied to clipboard
Link copied to clipboard

Allows user to change servo's direction configuration

Link copied to clipboard

The commanded servo position in the range [0.0, 1.0].

Link copied to clipboard

Provides access to the servo's PWM range configuration.

Functions

Link copied to clipboard
fun disable()

Disables PWM output for the underlying servo.

Link copied to clipboard
fun enable()

Enables PWM output for the underlying servo.

Link copied to clipboard
fun off()

Turns headlights off.

Link copied to clipboard
fun setBrightness(brightness: Double)

Sets brightness by scaling the PWM range.

Link copied to clipboard

Sets the headlight color/pattern.

fun setColor(pwm: Double)

Sets the headlight color/pattern using a raw PWM position.

Link copied to clipboard
fun setPwmRange(lower: Double, upper: Double)

Sets the PWM range of the associated servo.