Package crackers.kobots.devices.io
Class NeoKey
-
-
Field Summary
Fields Modifier and Type Field Description public final static Integer
DEFAULT_I2C_ADDRESS
public final static Integer
DEFAULT_I2C_BUS
private final NeoPixel
pixels
private Boolean
autoWrite
private Float
brightness
-
Constructor Summary
Constructors Constructor Description NeoKey(I2CDeviceInterface i2CDevice)
-
Method Summary
Modifier and Type Method Description final NeoPixel
getPixels()
Boolean
getAutoWrite()
Unit
setAutoWrite(Boolean autoWrite)
Float
getBrightness()
Unit
setBrightness(Float brightness)
final List<Boolean>
read()
Read all the switchesTODO for some reason, the read on a PULLUP is backwards final Boolean
get(Integer index)
Get a button value. final WS2811.PixelColor
color(Integer index)
Get the color of this key. final List<WS2811.PixelColor>
colors()
All the colors Unit
set(Integer index, WS2811.PixelColor color)
Set an individual pixel (this is available as an indexed value). Unit
set(Integer start, Integer end, WS2811.PixelColor color)
Set a range of pixels to a color. Unit
set(Integer start, Integer end, List<WS2811.PixelColor> colors)
Set a range of pixels to a range of colors. Unit
fill(WS2811.PixelColor color)
Fill the entire device with this color. Unit
close()
-
-
Method Detail
-
getAutoWrite
Boolean getAutoWrite()
-
setAutoWrite
Unit setAutoWrite(Boolean autoWrite)
-
getBrightness
Float getBrightness()
-
setBrightness
Unit setBrightness(Float brightness)
-
read
final List<Boolean> read()
Read all the switches
TODO for some reason, the read on a PULLUP is backwards
-
get
final Boolean get(Integer index)
Get a button value.
TODO for some reason, the read on a PULLUP is backwards
-
color
final WS2811.PixelColor color(Integer index)
Get the color of this key.
-
colors
final List<WS2811.PixelColor> colors()
All the colors
-
set
Unit set(Integer index, WS2811.PixelColor color)
Set an individual pixel (this is available as an indexed value). If autoWrite is enabled, the results are immediately uploaded.
-
set
Unit set(Integer start, Integer end, WS2811.PixelColor color)
Set a range of pixels to a color. If autoWrite is enabled, the results are immediately uploaded.
-
set
Unit set(Integer start, Integer end, List<WS2811.PixelColor> colors)
Set a range of pixels to a range of colors. The color list must be equal to or larger than the range specified. If autoWrite is enabled, the results are * immediately uploaded.
-
fill
Unit fill(WS2811.PixelColor color)
Fill the entire device with this color. If autoWrite is enabled, the results are immediately uploaded.
-
-
-
-