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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • 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()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AnodeRgbPwmLed

        AnodeRgbPwmLed(Integer redPin, Integer greenPin, Integer bluePin, PwmOutputDeviceFactoryInterface deviceFactory)
    • Method Detail

      • 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
      • on

         final Unit on()

        Turn all LEDs on.

      • off

         final Unit off()

        Turn all LEDs off.

      • toggle

         final Unit toggle()

        Toggle the state of all LEDs.