public interface NeoPixel extends MetaWearBoard.Module
Modifier and Type | Interface and Description |
---|---|
static class |
NeoPixel.ColorOrdering
Color ordering for the NeoPixel color values
|
static class |
NeoPixel.RotationDirection
Enumeration of rotation directions
|
static class |
NeoPixel.StrandSpeed
Operating speeds for a NeoPixel strand
|
Modifier and Type | Method and Description |
---|---|
void |
clearStrand(byte strand,
byte start,
byte end)
Clear pixel states on a strand
|
void |
deinitializeStrand(byte strand)
Free resources on the MetaWeard board for a NeoPixel strand
|
void |
holdStrand(byte strand)
Enables strand holding.
|
void |
initializeStrand(byte strand,
NeoPixel.ColorOrdering ordering,
NeoPixel.StrandSpeed speed,
byte gpioPin,
byte length)
Initialize memory on the MetaWear board for a NeoPixel strand
|
void |
releaseHold(byte strand)
Disables strand holding.
|
void |
rotate(byte strand,
NeoPixel.RotationDirection direction,
byte repetitions,
short period)
Rotate the pixels on a strand
|
void |
rotate(byte strand,
NeoPixel.RotationDirection direction,
short period)
Rotate the pixels on a strand indefinitely
|
void |
setPixel(byte strand,
byte pixel,
byte red,
byte green,
byte blue)
Set pixel color
|
void |
stopRotation(byte strand)
Stops the LED rotation
|
void initializeStrand(byte strand, NeoPixel.ColorOrdering ordering, NeoPixel.StrandSpeed speed, byte gpioPin, byte length)
strand
- Strand number (id) to initialize, can be in the range [0, 2]ordering
- Color ordering formatspeed
- Operating speedgpioPin
- GPIO pin the strand is connected tolength
- Number of pixels to initializevoid deinitializeStrand(byte strand)
strand
- Strand index to freevoid holdStrand(byte strand)
strand
- Strand number (id) to holdvoid releaseHold(byte strand)
strand
- Strand number (id) to releasevoid clearStrand(byte strand, byte start, byte end)
strand
- Strand number to clearstart
- Pixel index to start clearing fromend
- Pixel index to clear to, inclusivevoid setPixel(byte strand, byte pixel, byte red, byte green, byte blue)
strand
- Strand number the pixel is onpixel
- Index of the pixelred
- Red value, between [0, 255]green
- Green value, between [0, 255]blue
- Blue value, between [0, 255]void rotate(byte strand, NeoPixel.RotationDirection direction, byte repetitions, short period)
strand
- Strand to rotatedirection
- Rotation directionrepetitions
- Number of times to repeat the rotationperiod
- Amount of time, in milliseconds, between rotationsvoid rotate(byte strand, NeoPixel.RotationDirection direction, short period)
strand
- Strand to rotatedirection
- Rotation directionperiod
- Amount of time, in milliseconds, between rotationsvoid stopRotation(byte strand)
strand
- Strand to stop LED rotation