public interface NeoPixel extends MetaWearController.ModuleController
Module.NEO_PIXEL
Modifier and Type | Interface and Description |
---|---|
static class |
NeoPixel.Callbacks
Callbacks for NeoPixel module
|
static class |
NeoPixel.ColorOrdering
Color ordering for the NeoPixel color values
|
static class |
NeoPixel.Register
Enumeration of registers under the NeoPixel module
|
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,
byte holdState)
Set the hold state on a strand.
|
void |
initializeStrand(byte strand,
NeoPixel.ColorOrdering ordering,
NeoPixel.StrandSpeed speed,
byte ioPin,
byte length)
Initialize memory on the MetaWear board for a NeoPixel strand
|
void |
readHoldState(byte strand)
Read the hold state of a NeoPixel strand.
|
void |
readPixelState(byte strand,
byte pixel)
Read pixel color.
|
void |
readRotationState(byte strand)
Read rotation state of a NeoPixel strand.
|
void |
readStrandState(byte strand)
Read the state of a NeoPixel strand.
|
void |
rotateStrand(byte strand,
NeoPixel.RotationDirection direction,
byte repetitions,
short period)
Rotate the pixels on a strand
|
void |
setPixel(byte strand,
byte pixel,
byte red,
byte green,
byte blue)
Set pixel color
|
void initializeStrand(byte strand, NeoPixel.ColorOrdering ordering, NeoPixel.StrandSpeed speed, byte ioPin, byte length)
strand
- Strand number (id) to initialize, can be in the range [0, 2]ordering
- Color ordering formatspeed
- Operating speedioPin
- GPIO pin the strand is connected tolength
- Number of pixels to initializevoid readStrandState(byte strand)
strand
- Strand number to read information aboutNeoPixel.Callbacks.receivedStrandState(byte,
com.mbientlab.metawear.api.controller.NeoPixel.ColorOrdering,
com.mbientlab.metawear.api.controller.NeoPixel.StrandSpeed, byte, byte)
void holdStrand(byte strand, byte holdState)
strand
- Strand number to modifyholdState
- 0 to disable, 1 to enablevoid readHoldState(byte strand)
strand
- Strand index to read the hold state onNeoPixel.Callbacks.receivedHoldState(byte, byte)
void 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 readPixelState(byte strand, byte pixel)
strand
- Strand index the pixel resides onpixel
- Pixel index to read the color fromNeoPixel.Callbacks.receivedPixelColor(byte, byte, byte, byte, byte)
void rotateStrand(byte strand, NeoPixel.RotationDirection direction, byte repetitions, short period)
strand
- Strand to rotatedirection
- Rotation directionrepetitions
- Number of times to repeat the rotation. Use -1 to rotate indefinitely, 0 to terminateperiod
- Amount of time, in milliseconds, between rotationsvoid readRotationState(byte strand)
strand
- Strand index to readNeoPixel.Callbacks.receivedRotatationState(byte,
com.mbientlab.metawear.api.controller.NeoPixel.RotationDirection, byte, short)
void deinitializeStrand(byte strand)
strand
- Strand index to free