Package crackers.kobots.devices
Class AnodeRgbPwmLed
-
- All Implemented Interfaces:
-
com.diozero.api.DeviceInterface
,java.lang.AutoCloseable
public final class AnodeRgbPwmLed implements DeviceInterface
RGB LED with common anode - this is inverted from RgbPwmLed. Provides the same interface.
Basically, the LED pins are initially high and when the anode is high, the light is off.
-
-
Constructor Summary
Constructors Constructor Description AnodeRgbPwmLed(Integer redPin, Integer greenPin, Integer bluePin, PwmOutputDeviceFactoryInterface deviceFactory)
AnodeRgbPwmLed(Integer redPin, Integer greenPin, Integer bluePin)
-
Method Summary
Modifier and Type Method Description final FloatArray
getValues()
Get the value of all LEDs. final Unit
setValues(Float red, Float green, Float blue)
Set the value of all LEDs. final Unit
setColor(Color color)
Sets the Color of all the LEDs. final Unit
on()
Turn all LEDs on. final Unit
off()
Turn all LEDs off. final Unit
toggle()
Toggle the state of all LEDs. Unit
close()
-
-
Method Detail
-
getValues
final FloatArray getValues()
Get the value of all LEDs.
-
setValues
final Unit setValues(Float red, Float green, Float blue)
Set the value of all LEDs.
- Parameters:
red
- Red LED value (0..1).green
- Green LED value (0..1).blue
- Blue LED value (0..1).
-
setColor
final Unit setColor(Color color)
Sets the Color of all the LEDs.
- Parameters:
color
- The color to set
-
-
-
-