![]() |
eBoard
①⑧⑨
Written for SIA 2017/2018
|
[NEO] this allows you to access Adafruit LED-stripes More...
#include <eagle_NeoPixel.h>
Public Member Functions | |
| NeoPixel (uint16_t n, uint8_t p=6, uint16_t t=((1<< 6)|(1<< 4)|(0<< 2)|(2))+0x0000) | |
| this is the default constructor that should be used whenever the amount of leds etc... connected is known at compile time (most cases) More... | |
| NeoPixel (void) | |
| the empty constructor More... | |
| ~NeoPixel (void) | |
| the destructor [calling free on pixel and freeing input pin] More... | |
| void | begin (void) |
| this has to be called to start the communcation (you should call NeoPixel::setPin() before) More... | |
| void | show (void) |
| this will reveal the setPixels [via NeoPixel::setPixelColor() etc...] More... | |
| void | setPin (uint8_t p) |
| sets pin for communication More... | |
| void | setPixelColor (uint16_t n, uint8_t r, uint8_t g, uint8_t b) |
| sets the rgb color of a specific pixel More... | |
| void | setPixelColor (uint16_t n, uint8_t r, uint8_t g, uint8_t b, uint8_t w) |
| sets the rgbw color of a specific pixel More... | |
| void | setPixelColor (uint16_t n, uint32_t c) |
| sets the rgbw color of a specific pixel More... | |
| void | setBrightness (uint8_t val) |
| changes the brightness for all further acceses via NeoPixel::setPixelColor() More... | |
| void | clear (void) |
| this will reset all set pixels [won't call NeoPixel::show()] More... | |
| void | updateLength (uint16_t n) |
| this changes the length of the connected LED stripe More... | |
| void | updateType (uint16_t t) |
| this changes the type of communication between arduino and LED stripe More... | |
| uint8_t * | getPixels (void) const |
| this will give you access to the pixels More... | |
| uint8_t | getBrightness (void) const |
| returns the current set brightness More... | |
| int8_t | getPin (void) |
| this will return the set data pin More... | |
| uint16_t | numPixels (void) const |
| returns the size of the LED stripe More... | |
| uint32_t | getPixelColor (uint16_t n) const |
| returns the color of a specific pixel More... | |
| bool | canShow (void) |
| this will determine if the next show is available [last show finished] More... | |
Static Public Member Functions | |
| static uint32_t | Color (uint8_t r, uint8_t g, uint8_t b) |
| returns a color value that can be used with NeoPixel::setPixelColor() More... | |
| static uint32_t | Color (uint8_t r, uint8_t g, uint8_t b, uint8_t w) |
| returns a color value that can be used with NeoPixel::setPixelColor() More... | |
Protected Attributes | |
| bool | is800KHz |
| determines the speed the communcation is working on More... | |
| bool | begun |
| true if NeoPixel::begin has been called More... | |
| uint16_t | numLEDs |
| stores the amount of LEDs More... | |
| uint16_t | numBytes |
| stores the byte size [pixels] used internally More... | |
| int8_t | pin |
| stores the pin -1 if the pin wasn't set More... | |
| uint8_t | brightness |
| stores the brightness More... | |
| uint8_t * | pixels |
| stores the pixels More... | |
| uint8_t | aOffset [4] |
| stores the offsets in rgbw format More... | |
| uint32_t | endTime |
| stores the last call time of show for NeoPixel::canShow() More... | |
[NEO] this allows you to access Adafruit LED-stripes
[NEO] You can use this class like this:
There is also an example code provided with this library, called neo_animation
If you've included eBoard as an Arduino Library it is available via the examples tab [as the corresponding .ino file]
Keep in mind:
The NeoPixel uses a one-wire interface and is therefore very timing sensitive!
You can't expect any interrupt or buffer working properly!
So you should always have a listening line that will be disabled whenever NeoPixel::show() is called
Definition at line 136 of file eagle_NeoPixel.h.
| NeoPixel::NeoPixel | ( | uint16_t | n, |
| uint8_t | p = 6, |
||
| uint16_t | t = ((1<< 6)|(1<< 4)|(0<< 2)|(2))+0x0000 |
||
| ) |
this is the default constructor that should be used whenever the amount of leds etc... connected is known at compile time (most cases)
| n | the amount of LEDs connected to the pin |
| p | the (data) pin connected to the arduino |
| t | the type of com the NeoPixel should be talked to |
| NeoPixel::NeoPixel | ( | void | ) |
the empty constructor
| NeoPixel::~NeoPixel | ( | void | ) |
the destructor [calling free on pixel and freeing input pin]
| void NeoPixel::begin | ( | void | ) |
this has to be called to start the communcation (you should call NeoPixel::setPin() before)
Referenced by main().
Here is the caller graph for this function:
|
inline |
this will determine if the next show is available [last show finished]
| void NeoPixel::clear | ( | void | ) |
this will reset all set pixels [won't call NeoPixel::show()]
|
inlinestatic |
returns a color value that can be used with NeoPixel::setPixelColor()
| r | the red color [can be different dependent on NeoPixel::updateType()] |
| g | the green color [can be different dependent on NeoPixel::updateType()] |
| b | the blue color [can be different dependent on NeoPixel::updateType()] |
Referenced by shiftPx().
Here is the caller graph for this function:
|
inlinestatic |
returns a color value that can be used with NeoPixel::setPixelColor()
| r | the red color [can be different dependent on NeoPixel::updateType()] |
| g | the green color [can be different dependent on NeoPixel::updateType()] |
| b | the blue color [can be different dependent on NeoPixel::updateType()] |
| w | the 'white' color [can be different dependent on NeoPixel::updateType()] |
| uint8_t NeoPixel::getBrightness | ( | void | ) | const |
returns the current set brightness
| int8_t NeoPixel::getPin | ( | void | ) |
this will return the set data pin
| uint32_t NeoPixel::getPixelColor | ( | uint16_t | n | ) | const |
returns the color of a specific pixel
| uint8_t* NeoPixel::getPixels | ( | void | ) | const |
this will give you access to the pixels
| uint16_t NeoPixel::numPixels | ( | void | ) | const |
returns the size of the LED stripe
| void NeoPixel::setBrightness | ( | uint8_t | val | ) |
changes the brightness for all further acceses via NeoPixel::setPixelColor()
| val | the brightness-value |
Referenced by main().
Here is the caller graph for this function:| void NeoPixel::setPin | ( | uint8_t | p | ) |
sets pin for communication
| p | the (data) pin connected to the arduino |
| void NeoPixel::setPixelColor | ( | uint16_t | n, |
| uint8_t | r, | ||
| uint8_t | g, | ||
| uint8_t | b | ||
| ) |
sets the rgb color of a specific pixel
| n | the index of the pixel (starting at 0) |
| r | the red color [can be different dependent on NeoPixel::updateType()] |
| g | the green color [can be different dependent on NeoPixel::updateType()] |
| b | the blue color [can be different dependent on NeoPixel::updateType()] |
Referenced by shiftPx().
Here is the caller graph for this function:| void NeoPixel::setPixelColor | ( | uint16_t | n, |
| uint8_t | r, | ||
| uint8_t | g, | ||
| uint8_t | b, | ||
| uint8_t | w | ||
| ) |
sets the rgbw color of a specific pixel
| n | the index of the pixel (starting at 0) |
| r | the red color [can be different dependent on NeoPixel::updateType()] |
| g | the green color [can be different dependent on NeoPixel::updateType()] |
| b | the blue color [can be different dependent on NeoPixel::updateType()] |
| w | the 'white' color [can be different dependent on NeoPixel::updateType()] |
| void NeoPixel::setPixelColor | ( | uint16_t | n, |
| uint32_t | c | ||
| ) |
sets the rgbw color of a specific pixel
| n | the index of the pixel (starting at 0) |
| c | the NeoPixel::Color() you want |
| void NeoPixel::show | ( | void | ) |
this will reveal the setPixels [via NeoPixel::setPixelColor() etc...]
Referenced by shiftPx().
Here is the caller graph for this function:| void NeoPixel::updateLength | ( | uint16_t | n | ) |
this changes the length of the connected LED stripe
| n | the new length |
| void NeoPixel::updateType | ( | uint16_t | t | ) |
this changes the type of communication between arduino and LED stripe
| t | the new type [constant starting with EBOARD_NEO] |
|
protected |
stores the offsets in rgbw format
Definition at line 277 of file eagle_NeoPixel.h.
|
protected |
true if NeoPixel::begin has been called
Definition at line 262 of file eagle_NeoPixel.h.
|
protected |
stores the brightness
Definition at line 273 of file eagle_NeoPixel.h.
|
protected |
stores the last call time of show for NeoPixel::canShow()
Definition at line 279 of file eagle_NeoPixel.h.
|
protected |
determines the speed the communcation is working on
Definition at line 260 of file eagle_NeoPixel.h.
|
protected |
stores the byte size [pixels] used internally
Definition at line 266 of file eagle_NeoPixel.h.
|
protected |
stores the amount of LEDs
Definition at line 264 of file eagle_NeoPixel.h.
|
protected |
stores the pin -1 if the pin wasn't set
Definition at line 271 of file eagle_NeoPixel.h.
|
protected |
stores the pixels
Definition at line 275 of file eagle_NeoPixel.h.