Class AddressableLEDJNI

java.lang.Object
edu.wpi.first.hal.JNIWrapper
edu.wpi.first.hal.AddressableLEDJNI

public class AddressableLEDJNI extends JNIWrapper
Addressable LED HAL JNI Methods.
See Also:
  • "hal/AddressableLED.h"
  • Field Details

  • Method Details

    • initialize

      public static int initialize(int channel)
      Create a new instance of an Addressable LED port.
      Parameters:
      channel - the smartio channel
      Returns:
      Addressable LED handle
      See Also:
      • "HAL_InitializeAddressableLED"
    • free

      public static void free(int handle)
      Free the Addressable LED Handle.
      Parameters:
      handle - the Addressable LED handle to free
      See Also:
      • "HAL_FreeAddressableLED"
    • setStart

      public static void setStart(int handle, int start)
      Sets the start buffer location used for the LED strip.

      All addressable LEDs use a single backing buffer 1024 LEDs in size. The max length for a single output is 1024 LEDs (with an offset of zero).

      Parameters:
      handle - the Addressable LED handle
      start - the strip start, in LEDs
    • setLength

      public static void setLength(int handle, int length)
      Sets the length of the LED strip.

      All addressable LEDs use a single backing buffer 1024 LEDs in size. The max length for a single output is 1024 LEDs (with an offset of zero).

      Parameters:
      handle - the Addressable LED handle
      length - the strip length, in LEDs
    • setData

      public static void setData(int outStart, int colorOrder, byte[] data)
      Sets the led output data.

      All addressable LEDs use a single backing buffer 1024 LEDs in size. This function may be used to set part of or all of the buffer.

      Parameters:
      outStart - the strip start in the backing buffer, in LEDs
      colorOrder - the color order
      data - the buffer to write
      See Also:
      • "HAL_WriteAddressableLEDData"
    • setData

      public static void setData(int outStart, int colorOrder, byte[] data, int start, int len)
      Sets the led output data.

      All addressable LEDs use a single backing buffer 1024 LEDs in size. This function may be used to set part of or all of the buffer.

      Parameters:
      outStart - the strip start in the backing buffer, in LEDs
      colorOrder - the color order
      data - the buffer to write
      start - offset into data, in bytes
      len - Length of data, in bytes
    • setData

      public static void setData(int outStart, int colorOrder, ByteBuffer data)
      Sets the led output data.

      All addressable LEDs use a single backing buffer 1024 LEDs in size. This function may be used to set part of or all of the buffer.

      Parameters:
      outStart - the strip start in the backing buffer, in LEDs
      colorOrder - the color order
      data - the buffer to write
    • setData

      public static void setData(int outStart, int colorOrder, ByteBuffer data, int start, int len)
      Sets the led output data.

      All addressable LEDs use a single backing buffer 1024 LEDs in size. This function may be used to set part of or all of the buffer.

      Parameters:
      outStart - the strip start in the backing buffer, in LEDs
      colorOrder - the color order
      data - the buffer to write
      start - offset into data, in bytes
      len - Length of data, in bytes