![]() |
Pixie Chroma
Documentation for the easiest 5x7 LED displays for Arduino!
|
This is the software documentation for using Pixie Chroma functions on Arduino! For full example usage, see Demos. More...
#include <pixie_chroma_internal.h>
Public Member Functions | |
PixieChroma () | |
Construct a Pixie Chroma class object. More... | |
void | begin (const uint8_t data_pin, uint8_t pixies_x, uint8_t pixies_y) |
Initializes the display buffer, populates the XY coordinate table, defaults the display colors to green, loads the default CRGBPalette, initializes FastLED, and sets the default power budget. More... | |
void | begin_quad (uint8_t pixies_per_pin, uint8_t pixies_x, uint8_t pixies_y) |
Initializes the display buffer, populates the XY coordinate table, defaults the display colors to green, loads the default CRGBPalette, initializes FastLED for Quad Mode, and sets the default power budget. More... | |
void | set_brightness (uint8_t level) |
Takes an 8-bit brightness value and passes it to FastLED internally, to provide global brightness control with temporal dithering. More... | |
void | set_palette (const uint8_t *pal) |
Accepts a const uint8_t (8-bit) array to generate a FastLED Gradient Palette at runtime: More... | |
void | set_palette (CRGBPalette16 pal) |
Accepts a FastLED CRGBPalette16 object to set the current color palette for animation. More... | |
void | set_animation (void(*action)(PixieChroma *, float)) |
Accepts a preset or custom function to use for the animation ISR. More... | |
void | set_animation_speed (float speed) |
Used to scale the animation speed of animation ISRs that can use pix.animation_speed() to scale their speeds or for other effects. More... | |
void | set_gamma_correction (bool enabled) |
Allows you to enable built-in automatic gamma correction, using a fast LUT in pixie_utility.h. (Not enabled by default) More... | |
void | set_max_power (float volts, uint16_t milliamps) |
Sets the maximum power budget in volts and milliamps. More... | |
void | set_frame_rate_target (uint16_t target) |
Sets the target frame rate for animation. This target frame rate is only used to calculate delta in custom/preset animation functions. More... | |
void | set_line_wrap (bool enabled) |
Sets the line wrapping behavior. More... | |
void | set_update_mode (t_update_mode mode, uint16_t FPS=60) |
Allows for automatic show() calls at a specified frames per second if AUTOMATIC is used. (uses Ticker.attach_ms() internally) More... | |
void | write (const uint8_t *icon, uint8_t x_pos=0, uint8_t y_pos=0) |
Writes an icon* to a specified X and Y cursor position. More... | |
void | write (uint8_t icon_col_1, uint8_t icon_col_2, uint8_t icon_col_3, uint8_t icon_col_4, uint8_t icon_col_5, uint8_t x_pos=0, uint8_t y_pos=0) |
Writes an icon to a specified X and Y cursor position, taking five uint8_t as input for the column data. More... | |
void | write (char *message, uint8_t x_pos=0, uint8_t y_pos=0) |
Writes a char* string to a specified X and Y cursor position. More... | |
void | write (int16_t input, uint8_t x_pos=0, uint8_t y_pos=0) |
Writes a signed 16-bit integer to a specified X and Y cursor position. More... | |
void | write (uint16_t input, uint8_t x_pos=0, uint8_t y_pos=0) |
Writes an unsigned 16-bit integer to a specified X and Y cursor position. More... | |
void | write (int32_t input, uint8_t x_pos=0, uint8_t y_pos=0) |
Writes a signed 32-bit integer to a specified X and Y cursor position. More... | |
void | write (uint32_t input, uint8_t x_pos=0, uint8_t y_pos=0) |
Writes an unsigned 32-bit integer to a specified X and Y cursor position. More... | |
void | write (long unsigned int input, uint8_t x_pos=0, uint8_t y_pos=0) |
Writes an unsigned 32-bit integer to a specified X and Y cursor position. ( Stupid ESP-specific type ) More... | |
void | write (float input, uint8_t places=2, uint8_t x_pos=0, uint8_t y_pos=0) |
Writes a single-precision floating point value to a specified X and Y cursor position, to a specified number of decimal places. More... | |
void | write (double input, uint8_t places=2, uint8_t x_pos=0, uint8_t y_pos=0) |
Writes a double-precision floating point value to a specified X and Y cursor position, to a specified number of decimal places. More... | |
void | write_pix (char *message, int16_t x_offset=0, int16_t y_offset=0) |
Internal function for rendering char* strings to the mask buffer. More... | |
void | write_pix (const uint8_t *icon, int16_t x_offset=0, int16_t y_offset=0) |
Internal function for rendering icons to the mask buffer. More... | |
void | add_char (char c, int16_t x_pos, int16_t y_pos) |
Internal function for rendering a single char to the mask buffer. More... | |
void | add_char (const uint8_t *icon, int16_t x_pos, int16_t y_pos) |
Internal function for rendering a single icon to the mask buffer. More... | |
void | print (const uint8_t *icon) |
Prints an Icon to the displays, at the current cursor position. More... | |
void | print (uint8_t icon_col_1, uint8_t icon_col_2, uint8_t icon_col_3, uint8_t icon_col_4, uint8_t icon_col_5) |
Prints an icon to the displays at the current cursor position, taking five uint8_t as input for the column data. More... | |
void | print (char *message) |
Prints a char* string to the displays at the current cursor position. More... | |
void | print (int16_t input) |
Prints a signed 16-bit integer to the displays at the current cursor position. More... | |
void | print (uint16_t input) |
Prints an unsigned 16-bit integer to the displays at the current cursor position. More... | |
void | print (int32_t input) |
Prints a signed 32-bit integer to the displays at the current cursor position. More... | |
void | print (uint32_t input) |
Prints an unsigned 32-bit integer to the displays at the current cursor\ position. More... | |
void | print (long unsigned int input) |
Prints an unsigned 32-bit integer to the displays at the current cursor position. ( Dumb ESP-specific type ) More... | |
void | print (float input, uint8_t places=2) |
Prints a single-precision floating point integer to the displays at the current cursor position, to a specified number of decimal places. More... | |
void | print (double input, uint8_t places=2) |
Prints a double-precision floating point integer to the displays at the current cursor position, to a specified number of decimal places. More... | |
void | println (const uint8_t *icon) |
Prints an Icon to the displays at the current cursor position, then jumps to the next row in the Pixie display, similar to a newline '\n' character. More... | |
void | println (uint8_t icon_col_1, uint8_t icon_col_2, uint8_t icon_col_3, uint8_t icon_col_4, uint8_t icon_col_5) |
Prints an Icon to the displays at the current cursor position, (taking five uint8_t as input for the column data) then jumps to the next row in the Pixie display, similar to a newline '\n' character. More... | |
void | println (char *message) |
Prints a char* string to the displays at the current cursor position, then jumps to the next row in the Pixie display, similar to a newline '\n' character. More... | |
void | println (int16_t input) |
Prints a signed 16-bit integer to the displays at the current cursor position, then jumps to the next row in the Pixie display, similar to a newline '\n' character. More... | |
void | println (uint16_t input) |
Prints an unsigned 16-bit integer to the displays at the current cursor position, then jumps to the next row in the Pixie display, similar to a newline '\n' character. More... | |
void | println (int32_t input) |
Prints a signed 32-bit integer to the displays at the current cursor position, then jumps to the next row in the Pixie display, similar to a newline '\n' character. More... | |
void | println (uint32_t input) |
Prints an unsigned 32-bit integer to the displays at the current cursor position, then jumps to the next row in the Pixie display, similar to a newline '\n' character. More... | |
void | println (long unsigned int input) |
Prints an unsigned 32-bit integer to the displays at the current cursor position, then jumps to the next row in the Pixie display, similar to a newline '\n' character. ( Stupid ESP-specific type ) More... | |
void | println (float input, uint8_t places=2) |
Prints a single-precision floating point integer to the displays at the current cursor position (to a specified number of decimal places), then jumps to the next row in the Pixie display, similar to a newline '\n' character. More... | |
void | println (double input, uint8_t places=2) |
Prints a double-precision floating point integer to the displays at the current cursor position (to a specified number of decimal places), then jumps to the next row in the Pixie display, similar to a newline '\n' character. More... | |
void | set_cursor (uint8_t x_position, uint8_t y_position=0) |
Sets the cursor position in a 2D context, in whole displays. More... | |
uint8_t | get_cursor_x () |
Returns the cursor's X position. More... | |
uint8_t | get_cursor_y () |
Returns the cursor's Y position. More... | |
int16_t | get_cursor_x_exact () |
Returns the cursor's X position in exact pixel coordinates. More... | |
int16_t | get_cursor_y_exact () |
Returns the cursor's Y position in exact pixel coordinates. More... | |
void | clear () |
Clears (blackens) the current mask buffer and resets the cursor to 0,0. More... | |
void | show () |
Processes 1D image data into truncated versions, sending them to the Pixie Chroma displays. More... | |
void | hold () |
Freezes the current mask buffer in memory to prevent showing unfinished text if show() automaticall fires during construction of the current display data. More... | |
void | free () |
Unfreezes the current mask buffer in memory to allow showing updated text the next time show() is called. More... | |
void | color (CRGB col) |
Sets the entire color buffer to a CRGB value. More... | |
void | color (CRGB col, uint8_t x, uint8_t y) |
Sets a specific display in the color buffer to a CRGB value. More... | |
void | color (CRGB col, uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2) |
Sets a rectangular area in the color buffer to a CRGB value. More... | |
CRGB | kelvin_to_rgb (uint16_t temperature) |
Approximates the conversion of a blackbody radiation temperature (i.e. 3500K) to a CRGB color object. More... | |
void | dim (uint8_t amount, bool reset_cursor=false) |
Darkens the mask buffer by an 8-bit amount. Optionally resets the cursor position. More... | |
void | blur (fract8 blur_amount) |
Blurs the mask buffer in both axes by blur_amount. More... | |
void | blur_x (fract8 blur_amount) |
Blurs the mask buffer in the X axis by blur_amount. More... | |
void | blur_y (fract8 blur_amount) |
Blurs the mask buffer in the Y axis by blur_amount. More... | |
void | color_dim (uint8_t amount) |
Darkens the color buffer by an 8-bit amount. More... | |
void | color_blur (fract8 blur_amount) |
Blurs the color buffer in both axes by blur_amount. More... | |
void | color_blur_x (fract8 blur_amount) |
Blurs the color buffer in the X axis by blur_amount. More... | |
void | color_blur_y (fract8 blur_amount) |
Blurs the color buffer in the Y axis by blur_amount. More... | |
uint16_t | xy (int32_t x, int32_t y, bool wrap=false) |
This function returns the 1D color_map / mask index of a given 2D coordinate in the display matrix. More... | |
uint16_t | uv (float x, float y, bool wrap=false) |
This wrapper function returns the 1D color_map / mask index of a given OpenGL-style UV coordinate in the display matrix. More... | |
float | get_uv_x (int32_t x_pixel) |
Returns the X-axis UV coordinate for a given X-axis pixel position. More... | |
float | get_uv_y (int32_t y_pixel) |
Returns the Y-axis UV coordinate for a given Y-axis pixel position. More... | |
void | draw_line (int16_t x1, int16_t y1, int16_t x2, int16_t y2) |
Draws a line in the mask buffer using Bresenham's line algorithm. More... | |
void | print_xy_table () |
Prints the index table for the calculated XY map. Requires Serial.begin() first to function. More... | |
Public Attributes | |
CRGB * | color_map |
Contains the entire color map, including "invisible" areas. More... | |
uint8_t * | mask |
Contains the entire mask, including "invisible" areas. More... | |
CRGBPalette16 | current_palette |
The current FastLED CRGBPalette16 used for animations. More... | |
uint16_t | matrix_width |
Stores the final width of the matrix, including invisible pixels. More... | |
uint16_t | matrix_height |
Stores the final height of the matrix, including invisible pixels. More... | |
uint16_t | NUM_PIXELS |
Stores the total number of pixels, including invisible pixels. More... | |
uint16_t | NUM_LEDS |
Stores the total number of physical LEDs, not including invisible pixels. This is calculated for you during begin() with an internal function, calc_xy(). More... | |
float | delta = 1.0 |
Used by animation functions as a way of self-regulating speed if performance drops, similar to a game engine. More... | |
float | animation_speed = 1.0 |
Used by animation functions to scale the apparent speed of animation. More... | |
float | frame_rate |
Allows the user to access a live frame rate calculation (1 frame latency) More... | |
This is the software documentation for using Pixie Chroma functions on Arduino! For full example usage, see Demos.
Definition at line 26 of file pixie_chroma_internal.h.
PixieChroma::PixieChroma | ( | ) |
Construct a Pixie Chroma class object.
Used to initialize the PixieChroma library.
Example usage before setup()
would be:
#include "Pixie_Chroma.h" PixieChroma pix;
Because each of these functions are contained in the PixieChroma class object, you'll use them like this:
pix.print( "Hello!" );
Definition at line 33 of file pixie_chroma_internal.cpp.
void PixieChroma::begin | ( | const uint8_t | data_pin, |
uint8_t | pixies_x, | ||
uint8_t | pixies_y | ||
) |
Initializes the display buffer, populates the XY coordinate table, defaults the display colors to green, loads the default CRGBPalette, initializes FastLED, and sets the default power budget.
Pixie Chroma allows for multi-row displays, which are wired in reading order (left to right, top to bottom) and their shape is defined here. For example, a 16-Pixie display with two rows of eight:
data_pin | +--+-+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ | 1 |-->| 2 |-->| 3 |-->| 4 |-->| 5 |-->| 6 |-->| 7 |-->| 8 | +----+ +----+ +----+ +----+ +----+ +----+ +----+ +--+-+ | +--------------------------------------------------------------+ | +--+-+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ | 9 |-->| 10 |-->| 11 |-->| 12 |-->| 13 |-->| 14 |-->| 15 |-->| 16 | +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+
The corresponding setup for this display layout would be:
#include "Pixie_Chroma.h" PixieChroma pix; #define DATA_PIN 5 #define PIXIES_X 8 #define PIXIES_Y 2 void setup() { pix.begin( DATA_PIN, PIXIES_X, PIXIES_Y ); }
For faster performance on large displays, see begin_quad().
data_pin | GPIO pin to use for FastLED output |
pixies_x | Number of Pixie PCBs in the X axis of your display |
pixies_y | Number of Pixie PCBs in the Y axis of your display |
Definition at line 78 of file pixie_chroma_internal.cpp.
void PixieChroma::begin_quad | ( | uint8_t | pixies_per_pin, |
uint8_t | pixies_x, | ||
uint8_t | pixies_y | ||
) |
Initializes the display buffer, populates the XY coordinate table, defaults the display colors to green, loads the default CRGBPalette, initializes FastLED for Quad Mode, and sets the default power budget.
This version of begin() is special, in that it will send your image data to the LEDs in 4 parallel streams to increase speed.
Unfortunately, this requires hard-coded pins on the ESP8266 and ESP32 to function due to FastLED limitations:
On each data line, you'll wire pixies_per_pin
number of Pixie Chromas, with the final image being seamlessly spread across these four lines.
For example, if you have 16 Pixie Chromas (in two rows of eight) and have Quad Mode enabled, then each of the 4 data lines will have 4 Pixie Chromas like so:
The corresponding setup for this display layout would be:
#include "Pixie_Chroma.h" PixieChroma pix; #define PIXIES_PER_PIN 4 #define PIXIES_X 8 #define PIXIES_Y 2 void setup() { pix.begin_quad( PIXIES_PER_PIN, PIXIES_X, PIXIES_Y ); }
Then, with the displays physically arranged in reading order ( left to right, top to bottom ) you're ready to begin!
DATA_OUT_1 --+ DATA_OUT_2 ----+ | | +--+-+ +----+ +----+ +----+ || +--+-+ +----+ +----+ +----+ | 1 |-->| 2 |-->| 3 |-->| 4 | || | 5 |-->| 6 |-->| 7 |-->| 8 | +----+ +----+ +----+ +----+ || +----+ +----+ +----+ +----+ DATA_OUT_3 --+ DATA_OUT_4 ----+ | | +--+-+ +----+ +----+ +----+ || +--+-+ +----+ +----+ +----+ | 9 |-->| 10 |-->| 11 |-->| 12 | || | 13 |-->| 14 |-->| 15 |-->| 16 | +----+ +----+ +----+ +----+ || +----+ +----+ +----+ +----+
Using begin_quad() to enable the Quad Mode driver will always send the 4 lines of data in parallel, saving on time per frame.
begin_quad() ideally should not be used with less than 4 Pixie Chromas, and with at least one on each line. Even if only two lines are physically used, all 4 pins are still occupied by Quad Mode.
pixies_per_pin | Pixies per data pin |
pixies_x | Number of Pixie PCBs in the X axis of your display |
pixies_y | Number of Pixie PCBs in the Y axis of your display |
Definition at line 196 of file pixie_chroma_internal.cpp.
void PixieChroma::set_brightness | ( | uint8_t | level | ) |
Takes an 8-bit brightness value and passes it to FastLED internally, to provide global brightness control with temporal dithering.
level | 8-bit global brightness value ( 0-255 ) |
Definition at line 267 of file pixie_chroma_internal.cpp.
void PixieChroma::set_palette | ( | const uint8_t * | pal | ) |
Accepts a const uint8_t (8-bit) array to generate a FastLED Gradient Palette at runtime:
const uint8_t* my_gradient_palette[] = { [INDEX], [R_VAL], [G_VAL], [B_VAL], 0, 255, 0, 0, 127, 0, 255, 0, 255, 0, 0, 255, };
On each line is the index of the color ( 0-255 ) to express the position in the gradient this color occurs. So in the given example, it is a gradient from red at 0, to green at 127, to blue at 255.
pal | FastLED "Gradient Palette" array |
Definition at line 291 of file pixie_chroma_internal.cpp.
void PixieChroma::set_palette | ( | CRGBPalette16 | pal | ) |
Accepts a FastLED CRGBPalette16 object to set the current color palette for animation.
pal | FastLED CRGBPalette16 object to use |
Definition at line 303 of file pixie_chroma_internal.cpp.
void PixieChroma::set_animation | ( | void(*)(PixieChroma *, float) | action | ) |
Accepts a preset or custom function to use for the animation ISR.
For a list of predefined animations, see pixie_animations.h.
action | Function to set as an animation ISR |
Definition at line 317 of file pixie_chroma_internal.cpp.
void PixieChroma::set_animation_speed | ( | float | speed | ) |
Used to scale the animation speed of animation ISRs that can use pix.animation_speed() to scale their speeds or for other effects.
speed | Floating point value: 1.0 = 100%, 3.2 = 320%, 0.5 = 50% |
Definition at line 329 of file pixie_chroma_internal.cpp.
void PixieChroma::set_gamma_correction | ( | bool | enabled | ) |
Allows you to enable built-in automatic gamma correction, using a fast LUT in pixie_utility.h. (Not enabled by default)
enabled | Whether or not to apply gamma correction |
Definition at line 341 of file pixie_chroma_internal.cpp.
void PixieChroma::set_max_power | ( | float | volts, |
uint16_t | milliamps | ||
) |
Sets the maximum power budget in volts and milliamps.
Knowing the average power consumption of these LEDs at any given color, FastLED will automatically globally scale down the output values with temporal dithering to lower power usage until it is within the budget defined here. Defaults to 5.0V / 500mA to protect PC USB ports if the Pixies are not independently powered. ( 2000mA = 2A, 500mA = 0.5A, etc. )
volts | Total LED power budget in volts. ( default: 5.0 ) |
milliamps | Total LED power budget in milliamps ( default 500 ) |
Definition at line 411 of file pixie_chroma_internal.cpp.
void PixieChroma::set_frame_rate_target | ( | uint16_t | target | ) |
Sets the target frame rate for animation. This target frame rate is only used to calculate delta
in custom/preset animation functions.
This does not change your real frame rate, or even govern it: it is left up to the user to use frequent show() calls or auto_update(). The "target frame
rate" here is used to calculate delta
for the animation functions, and should be set as close as possible to the rate at which you are expecting to call show().
This function is automatically called with a matching FPS when you use set_update_mode( AUTOMATIC, FPS )
.
target | Target frame rate for animation. |
Definition at line 434 of file pixie_chroma_internal.cpp.
void PixieChroma::set_line_wrap | ( | bool | enabled | ) |
Sets the line wrapping behavior.
set_line_wrap( true );
will automatically enter next line when the edge of the display is reached, and set_line_wrap( false );
will not.
enabled | Enable or disable auto line-wrapping |
Definition at line 449 of file pixie_chroma_internal.cpp.
void PixieChroma::set_update_mode | ( | t_update_mode | mode, |
uint16_t | FPS = 60 |
||
) |
Allows for automatic show() calls at a specified frames per second if AUTOMATIC is used. (uses Ticker.attach_ms() internally)
This lets you use things like print() as infrequently as you'd like, since show() will automatically run in the background to keep the current animation function running smoothly.
Use in conjunction with hold() and free() to prevent show() calls during text/image construction, leading to unintended partial frames being shown. Be aware, hold() does not prevent animation / palette updates (only mask updates) so animations will still run smoothly during hold() times until free() is called and the mask is finally updated.
mode | AUTOMATIC or MANUAL. AUTOMATIC will call show() at FPS using an ISR, MANUAL allows you call show() when you like. |
FPS | Update this many times per second (Default: 60) Only applicable when mode is AUTOMATIC |
Definition at line 476 of file pixie_chroma_internal.cpp.
void PixieChroma::write | ( | const uint8_t * | icon, |
uint8_t | x_pos = 0 , |
||
uint8_t | y_pos = 0 |
||
) |
Writes an icon* to a specified X and Y cursor position.
icon | The icon to write |
x_pos | X cursor position of write [optional] |
y_pos | Y cursor position of write [optional] |
Definition at line 503 of file pixie_chroma_internal.cpp.
void PixieChroma::write | ( | uint8_t | icon_col_1, |
uint8_t | icon_col_2, | ||
uint8_t | icon_col_3, | ||
uint8_t | icon_col_4, | ||
uint8_t | icon_col_5, | ||
uint8_t | x_pos = 0 , |
||
uint8_t | y_pos = 0 |
||
) |
Writes an icon to a specified X and Y cursor position, taking five uint8_t as input for the column data.
Example:
pix.write( B00101111, B01001001, B01001001, B01001001, B00110001 ); OR, WRITTEN VERTICALLY: pix.write( , , , , ); 1 1 1 1 1 LSB 1 0 0 0 0 1 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 0 0 0 MSB (unused) B B B B B
This writes a "5" to the display, seen above in the "1" bits of each column. The MSB (highest bit) is not used in icons.
icon_col_1 | Column 1 data of this icon |
icon_col_2 | Column 2 data of this icon |
icon_col_3 | Column 3 data of this icon |
icon_col_4 | Column 4 data of this icon |
icon_col_5 | Column 5 data of this icon |
x_pos | X cursor position of write [optional] |
y_pos | Y cursor position of write [optional] |
Definition at line 546 of file pixie_chroma_internal.cpp.
void PixieChroma::write | ( | char * | message, |
uint8_t | x_pos = 0 , |
||
uint8_t | y_pos = 0 |
||
) |
Writes a char* string to a specified X and Y cursor position.
message | char* string to write |
x_pos | X cursor position of write [optional] |
y_pos | Y cursor position of write [optional] |
Definition at line 566 of file pixie_chroma_internal.cpp.
void PixieChroma::write | ( | int16_t | input, |
uint8_t | x_pos = 0 , |
||
uint8_t | y_pos = 0 |
||
) |
Writes a signed 16-bit integer to a specified X and Y cursor position.
input | Signed integer to write |
x_pos | X cursor position of write [optional] |
y_pos | Y cursor position of write [optional] |
Definition at line 583 of file pixie_chroma_internal.cpp.
void PixieChroma::write | ( | uint16_t | input, |
uint8_t | x_pos = 0 , |
||
uint8_t | y_pos = 0 |
||
) |
Writes an unsigned 16-bit integer to a specified X and Y cursor position.
input | Unsigned integer to write |
x_pos | X cursor position of write [optional] |
y_pos | Y cursor position of write [optional] |
Definition at line 603 of file pixie_chroma_internal.cpp.
void PixieChroma::write | ( | int32_t | input, |
uint8_t | x_pos = 0 , |
||
uint8_t | y_pos = 0 |
||
) |
Writes a signed 32-bit integer to a specified X and Y cursor position.
input | Signed integer to write |
x_pos | X cursor position of write [optional] |
y_pos | Y cursor position of write [optional] |
Definition at line 623 of file pixie_chroma_internal.cpp.
void PixieChroma::write | ( | uint32_t | input, |
uint8_t | x_pos = 0 , |
||
uint8_t | y_pos = 0 |
||
) |
Writes an unsigned 32-bit integer to a specified X and Y cursor position.
input | Unsigned integer to write |
x_pos | X cursor position of write [optional] |
y_pos | Y cursor position of write [optional] |
Definition at line 643 of file pixie_chroma_internal.cpp.
void PixieChroma::write | ( | long unsigned int | input, |
uint8_t | x_pos = 0 , |
||
uint8_t | y_pos = 0 |
||
) |
Writes an unsigned 32-bit integer to a specified X and Y cursor position. ( Stupid ESP-specific type )
input | Unsigned integer to write |
x_pos | X cursor position of write [optional] |
y_pos | Y cursor position of write [optional] |
Definition at line 664 of file pixie_chroma_internal.cpp.
void PixieChroma::write | ( | float | input, |
uint8_t | places = 2 , |
||
uint8_t | x_pos = 0 , |
||
uint8_t | y_pos = 0 |
||
) |
Writes a single-precision floating point value to a specified X and Y cursor position, to a specified number of decimal places.
input | Single-precision float to write |
places | Number of decimal places to show [optional] |
x_pos | X cursor position of write [optional] |
y_pos | Y cursor position of write [optional] |
Definition at line 708 of file pixie_chroma_internal.cpp.
void PixieChroma::write | ( | double | input, |
uint8_t | places = 2 , |
||
uint8_t | x_pos = 0 , |
||
uint8_t | y_pos = 0 |
||
) |
Writes a double-precision floating point value to a specified X and Y cursor position, to a specified number of decimal places.
input | Double-precision float to write |
places | Number of decimal places to show [optional] |
x_pos | X cursor position of write [optional] |
y_pos | Y cursor position of write [optional] |
Definition at line 686 of file pixie_chroma_internal.cpp.
void PixieChroma::write_pix | ( | char * | message, |
int16_t | x_dest = 0 , |
||
int16_t | y_dest = 0 |
||
) |
Internal function for rendering char* strings to the mask buffer.
All other write() function overloads eventually end up casted to char* strings and passed to this function for rendering. This can also be used to write char* strings that are not aligned to whole display positions, such as during smooth scrolling.
message | char* of text to render |
x_dest | X pixel position of write [optional] |
y_dest | Y pixel position of write [optional] |
Definition at line 753 of file pixie_chroma_internal.cpp.
void PixieChroma::write_pix | ( | const uint8_t * | icon, |
int16_t | x_dest = 0 , |
||
int16_t | y_dest = 0 |
||
) |
Internal function for rendering icons to the mask buffer.
This can also be used to write Icons that are not aligned to whole display positions, such as during smooth scrolling.
icon | Icon to render |
x_dest | X pixel position of write [optional] |
y_dest | Y pixel position of write [optional] |
Definition at line 730 of file pixie_chroma_internal.cpp.
void PixieChroma::add_char | ( | char | chr, |
int16_t | x_dest, | ||
int16_t | y_dest | ||
) |
Internal function for rendering a single char to the mask buffer.
All other write() function overloads eventually end up casted to char* strings and passed to this function one character at a time for rendering.
chr | char to render |
x_dest | X pixel position of write |
y_dest | Y pixel position of write |
Definition at line 806 of file pixie_chroma_internal.cpp.
void PixieChroma::add_char | ( | const uint8_t * | icon, |
int16_t | x_dest, | ||
int16_t | y_dest | ||
) |
Internal function for rendering a single icon to the mask buffer.
icon | Icon column data to render |
x_dest | X pixel position of write |
y_dest | Y pixel position of write |
Definition at line 842 of file pixie_chroma_internal.cpp.
void PixieChroma::print | ( | const uint8_t * | icon | ) |
Prints an Icon to the displays, at the current cursor position.
icon | Icon column data to render |
Definition at line 872 of file pixie_chroma_internal.cpp.
void PixieChroma::print | ( | uint8_t | icon_col_1, |
uint8_t | icon_col_2, | ||
uint8_t | icon_col_3, | ||
uint8_t | icon_col_4, | ||
uint8_t | icon_col_5 | ||
) |
Prints an icon to the displays at the current cursor position, taking five uint8_t as input for the column data.
Example:
pix.print( B00101111, B01001001, B01001001, B01001001, B00110001 ); OR, WRITTEN VERTICALLY: pix.print( , , , , ); 1 1 1 1 1 LSB 1 0 0 0 0 1 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 0 0 0 MSB ( unused ) B B B B B
This writes a "5" to the display, seen above in the "1" bits of each column. The MSB ( highest bit ) is not used in icons.
icon_col_1 | Column 1 data of this icon |
icon_col_2 | Column 2 data of this icon |
icon_col_3 | Column 3 data of this icon |
icon_col_4 | Column 4 data of this icon |
icon_col_5 | Column 5 data of this icon |
Definition at line 913 of file pixie_chroma_internal.cpp.
void PixieChroma::print | ( | char * | message | ) |
Prints a char* string to the displays at the current cursor position.
message | char* string to print |
Definition at line 937 of file pixie_chroma_internal.cpp.
void PixieChroma::print | ( | int16_t | input | ) |
Prints a signed 16-bit integer to the displays at the current cursor position.
input | Signed integer to print |
Definition at line 957 of file pixie_chroma_internal.cpp.
void PixieChroma::print | ( | uint16_t | input | ) |
Prints an unsigned 16-bit integer to the displays at the current cursor position.
input | Unsigned integer to print |
Definition at line 975 of file pixie_chroma_internal.cpp.
void PixieChroma::print | ( | int32_t | input | ) |
Prints a signed 32-bit integer to the displays at the current cursor position.
input | Signed integer to print |
Definition at line 993 of file pixie_chroma_internal.cpp.
void PixieChroma::print | ( | uint32_t | input | ) |
Prints an unsigned 32-bit integer to the displays at the current cursor\ position.
input | Unsigned integer to print |
Definition at line 1011 of file pixie_chroma_internal.cpp.
void PixieChroma::print | ( | long unsigned int | input | ) |
Prints an unsigned 32-bit integer to the displays at the current cursor position. ( Dumb ESP-specific type )
input | Unsigned integer to print |
Definition at line 1029 of file pixie_chroma_internal.cpp.
void PixieChroma::print | ( | float | input, |
uint8_t | places = 2 |
||
) |
Prints a single-precision floating point integer to the displays at the current cursor position, to a specified number of decimal places.
input | float to print |
places | Number of decimal places to print [optional] |
Definition at line 1067 of file pixie_chroma_internal.cpp.
void PixieChroma::print | ( | double | input, |
uint8_t | places = 2 |
||
) |
Prints a double-precision floating point integer to the displays at the current cursor position, to a specified number of decimal places.
input | double to print |
places | Number of decimal places to print [optional] |
Definition at line 1048 of file pixie_chroma_internal.cpp.
void PixieChroma::println | ( | const uint8_t * | icon | ) |
Prints an Icon to the displays at the current cursor position, then jumps to the next row in the Pixie display, similar to a newline '\n' character.
icon | Icon column data to print |
Definition at line 1083 of file pixie_chroma_internal.cpp.
void PixieChroma::println | ( | uint8_t | icon_col_1, |
uint8_t | icon_col_2, | ||
uint8_t | icon_col_3, | ||
uint8_t | icon_col_4, | ||
uint8_t | icon_col_5 | ||
) |
Prints an Icon to the displays at the current cursor position, (taking five uint8_t as input for the column data) then jumps to the next row in the Pixie display, similar to a newline '\n' character.
icon_col_1 | Column 1 data of this icon |
icon_col_2 | Column 2 data of this icon |
icon_col_3 | Column 3 data of this icon |
icon_col_4 | Column 4 data of this icon |
icon_col_5 | Column 5 data of this icon |
Definition at line 1107 of file pixie_chroma_internal.cpp.
void PixieChroma::println | ( | char * | message | ) |
Prints a char* string to the displays at the current cursor position, then jumps to the next row in the Pixie display, similar to a newline '\n' character.
message | char* string to print |
Definition at line 1134 of file pixie_chroma_internal.cpp.
void PixieChroma::println | ( | int16_t | input | ) |
Prints a signed 16-bit integer to the displays at the current cursor position, then jumps to the next row in the Pixie display, similar to a newline '\n' character.
input | Signed 16-bit integer to print |
Definition at line 1152 of file pixie_chroma_internal.cpp.
void PixieChroma::println | ( | uint16_t | input | ) |
Prints an unsigned 16-bit integer to the displays at the current cursor position, then jumps to the next row in the Pixie display, similar to a newline '\n' character.
input | Unsigned 16-bit integer to print |
Definition at line 1167 of file pixie_chroma_internal.cpp.
void PixieChroma::println | ( | int32_t | input | ) |
Prints a signed 32-bit integer to the displays at the current cursor position, then jumps to the next row in the Pixie display, similar to a newline '\n' character.
input | Signed 32-bit integer to print |
Definition at line 1182 of file pixie_chroma_internal.cpp.
void PixieChroma::println | ( | uint32_t | input | ) |
Prints an unsigned 32-bit integer to the displays at the current cursor position, then jumps to the next row in the Pixie display, similar to a newline '\n' character.
input | Unsigned 32-bit integer to print |
Definition at line 1197 of file pixie_chroma_internal.cpp.
void PixieChroma::println | ( | long unsigned int | input | ) |
Prints an unsigned 32-bit integer to the displays at the current cursor position, then jumps to the next row in the Pixie display, similar to a newline '\n' character. ( Stupid ESP-specific type )
input | Unsigned 32-bit integer to print |
Definition at line 1212 of file pixie_chroma_internal.cpp.
void PixieChroma::println | ( | float | input, |
uint8_t | places = 2 |
||
) |
Prints a single-precision floating point integer to the displays at the current cursor position (to a specified number of decimal places), then jumps to the next row in the Pixie display, similar to a newline '\n' character.
input | float to print |
places | Number of decimal places to print [optional] |
Definition at line 1246 of file pixie_chroma_internal.cpp.
void PixieChroma::println | ( | double | input, |
uint8_t | places = 2 |
||
) |
Prints a double-precision floating point integer to the displays at the current cursor position (to a specified number of decimal places), then jumps to the next row in the Pixie display, similar to a newline '\n' character.
input | double to print |
places | Number of decimal places to print [optional] |
Definition at line 1229 of file pixie_chroma_internal.cpp.
void PixieChroma::set_cursor | ( | uint8_t | x_position, |
uint8_t | y_position = 0 |
||
) |
Sets the cursor position in a 2D context, in whole displays.
Wherever the cursor is, is where the next call to print() or write() will originate. Position is counted from zero. Remember: each Pixie Chroma has two "displays" on it.
+-----------------+ +-----------------+ +-----------------+ | + + + | | + + + | | + + + | |+-----+ +-----+| |+-----+ +-----+| |+-----+ +-----+| || | | || || | | || || | | || || | | || || | | || || | | || || 0,0 | | 1,0 ||-->|| 2,0 | | 3,0 ||-->|| 4,0 | | 5,0 || || | | || || | | || || | | || || | | || || | | || || | | || |+-----+ +-----+| |+-----+ +-----+| |+-----+ +-----+| | + + + | | + + + | | + + + | +-----------------+ +-----------------+ +-----------------+ | +-------------------------------------------+ | V +-----------------+ +-----------------+ +-----------------+ | + + + | | + + + | | + + + | |+-----+ +-----+| |+-----+ +-----+| |+-----+ +-----+| || | | || || | | || || | | || || | | || || | | || || | | || || 0,1 | | 1,1 ||-->|| 2,1 | | 3,1 ||-->|| 4,0 | | 5,1 || || | | || || | | || || | | || || | | || || | | || || | | || |+-----+ +-----+| |+-----+ +-----+| |+-----+ +-----+| | + + + | | + + + | | + + + | +-----------------+ +-----------------+ +-----------------+
For example:
set_cursor( 1,0 )
sets the cursor to the second display in the first row.
set_cursor( 3,1 )
sets the cursor to the fourth display in the second row.
x_position | New cursor position on the X-axis, in whole displays |
y_position | New cursor position on the Y-axis, in whole displays |
Definition at line 391 of file pixie_chroma_internal.cpp.
uint8_t PixieChroma::get_cursor_x | ( | ) |
Returns the cursor's X position.
Definition at line 1428 of file pixie_chroma_internal.cpp.
uint8_t PixieChroma::get_cursor_y | ( | ) |
Returns the cursor's Y position.
Definition at line 1439 of file pixie_chroma_internal.cpp.
int16_t PixieChroma::get_cursor_x_exact | ( | ) |
Returns the cursor's X position in exact pixel coordinates.
Definition at line 1450 of file pixie_chroma_internal.cpp.
int16_t PixieChroma::get_cursor_y_exact | ( | ) |
Returns the cursor's Y position in exact pixel coordinates.
Definition at line 1461 of file pixie_chroma_internal.cpp.
void PixieChroma::clear | ( | ) |
Clears (blackens) the current mask buffer and resets the cursor to 0,0.
Definition at line 1470 of file pixie_chroma_internal.cpp.
void PixieChroma::show | ( | ) |
Processes 1D image data into truncated versions, sending them to the Pixie Chroma displays.
FastLED.show() is called here.***
Definition at line 1907 of file pixie_chroma_internal.cpp.
void PixieChroma::hold | ( | ) |
Freezes the current mask buffer in memory to prevent showing unfinished text if show() automaticall fires during construction of the current display data.
Use free() to unfreeze.
Definition at line 1884 of file pixie_chroma_internal.cpp.
void PixieChroma::free | ( | ) |
Unfreezes the current mask buffer in memory to allow showing updated text the next time show() is called.
Definition at line 1894 of file pixie_chroma_internal.cpp.
void PixieChroma::color | ( | CRGB | col | ) |
Sets the entire color buffer to a CRGB value.
Example:
pix.color( CRGB( 0,255,255 ) );
This would set all displays to cyan, a mix of green and blue.
col | FastLED CRGB color |
Definition at line 1649 of file pixie_chroma_internal.cpp.
void PixieChroma::color | ( | CRGB | col, |
uint8_t | x, | ||
uint8_t | y | ||
) |
Sets a specific display in the color buffer to a CRGB value.
Example:
pix.color( CRGB( 0,255,255 ), 1, 0 );
This would set the second display of the first row to cyan, a mix of green and blue.
col | FastLED CRGB color |
x | X coordinate of display |
y | y coordinate of display |
Definition at line 1670 of file pixie_chroma_internal.cpp.
void PixieChroma::color | ( | CRGB | col, |
uint8_t | x1, | ||
uint8_t | y1, | ||
uint8_t | x2, | ||
uint8_t | y2 | ||
) |
Sets a rectangular area in the color buffer to a CRGB value.
Example:
pix.color( CRGB( 0,255,255 ), 0, 0, 5, 5 );
This would set the first five columns and rows of the color buffer to cyan, a mix of green and blue.
col | FastLED CRGB color |
x1 | Starting X coordinate of the rectangle |
y1 | Starting Y coordinate of the rectangle |
x2 | Ending X coordinate of the rectangle ( inclusive ) |
y2 | Ending Y coordinate of the rectangle ( inclusive ) |
Definition at line 1704 of file pixie_chroma_internal.cpp.
CRGB PixieChroma::kelvin_to_rgb | ( | uint16_t | temperature | ) |
Approximates the conversion of a blackbody radiation temperature (i.e. 3500K) to a CRGB color object.
This can be used within other Pixie color functions like so:
pix.color( kelvin_to_rgb( 3000 ) );
This would render a warm-white color. This measurement system is often used in household LED bulbs, with colors like:
temperature | Blackbody radiation temperature in Kelvin |
Definition at line 1839 of file pixie_chroma_internal.cpp.
void PixieChroma::dim | ( | uint8_t | amount, |
bool | reset_cursor = false |
||
) |
Darkens the mask buffer by an 8-bit amount. Optionally resets the cursor position.
amount | 8-bit amount to darken the mask |
reset_cursor | Reset the cursor to 0,0 [optional] |
Definition at line 1326 of file pixie_chroma_internal.cpp.
void PixieChroma::blur | ( | fract8 | blur_amount | ) |
Blurs the mask buffer in both axes by blur_amount.
blur_amount | Amount to blur |
Definition at line 1257 of file pixie_chroma_internal.cpp.
void PixieChroma::blur_x | ( | fract8 | blur_amount | ) |
Blurs the mask buffer in the X axis by blur_amount.
blur_amount | Amount to blur |
Definition at line 1269 of file pixie_chroma_internal.cpp.
void PixieChroma::blur_y | ( | fract8 | blur_amount | ) |
Blurs the mask buffer in the Y axis by blur_amount.
blur_amount | Amount to blur |
Definition at line 1296 of file pixie_chroma_internal.cpp.
void PixieChroma::color_dim | ( | uint8_t | amount | ) |
Darkens the color buffer by an 8-bit amount.
amount | 8-bit amount to darken the mask |
Definition at line 1416 of file pixie_chroma_internal.cpp.
void PixieChroma::color_blur | ( | fract8 | blur_amount | ) |
Blurs the color buffer in both axes by blur_amount.
blur_amount | Amount to blur |
Definition at line 1353 of file pixie_chroma_internal.cpp.
void PixieChroma::color_blur_x | ( | fract8 | blur_amount | ) |
Blurs the color buffer in the X axis by blur_amount.
blur_amount | Amount to blur |
Definition at line 1365 of file pixie_chroma_internal.cpp.
void PixieChroma::color_blur_y | ( | fract8 | blur_amount | ) |
Blurs the color buffer in the Y axis by blur_amount.
blur_amount | Amount to blur |
Definition at line 1390 of file pixie_chroma_internal.cpp.
uint16_t PixieChroma::xy | ( | int32_t | x, |
int32_t | y, | ||
bool | wrap = false |
||
) |
This function returns the 1D color_map / mask index of a given 2D coordinate in the display matrix.
The XY Table is generated during begin()
by an internal function, calc_xy()
. Each cell of the table denotes at what index that physical pixel location is inside of the 1D color_map / mask arrays.
For example, here is the XY Table for a single Pixie:
70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 |
84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 |
98 | 0 | 1 | 2 | 3 | 4 | 99 | 100 | 35 | 36 | 37 | 38 | 39 | 101 |
102 | 5 | 6 | 7 | 8 | 9 | 103 | 104 | 40 | 41 | 42 | 43 | 44 | 105 |
106 | 10 | 11 | 12 | 13 | 14 | 107 | 108 | 45 | 46 | 47 | 48 | 49 | 109 |
110 | 15 | 16 | 17 | 18 | 19 | 111 | 112 | 50 | 51 | 52 | 53 | 54 | 113 |
114 | 20 | 21 | 22 | 23 | 24 | 115 | 116 | 55 | 56 | 57 | 58 | 59 | 117 |
118 | 25 | 26 | 27 | 28 | 29 | 119 | 120 | 60 | 61 | 62 | 63 | 64 | 121 |
122 | 30 | 31 | 32 | 33 | 34 | 123 | 124 | 65 | 66 | 67 | 68 | 69 | 125 |
126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 |
140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 |
With this example table, a given XY coordinate of (3, 4)
would return 12
. Thus, modifying the color_map or mask at index 12
would influence the pixel at the physical location of (3, 4)
.
Starting from 0
at the top-left with the first visible pixel, (of the first display in the XY Table) the index increases to 69
, (the last visible pixel in the matrix) before starting to count invisible pixels at index 70
and up through 153
.
With this example table setup, the first 70 indices of color_map / mask are visible pixels, and the remaining 84 are invisible. (Simulated margin between displays)
Optionally, the result of this function can be run through a wrapping function that allows coordinates out of range to wrap around to the opposite side of the 2D matrix.
If wrap is not enabled, any coordinates outside of the display matrix will be parsed to a 1D index that is completely unused and unseen.
x | Signed 2D X coordinate |
y | Signed 2D Y coordinate |
wrap | Enable wrapping function [optional] |
Definition at line 1530 of file pixie_chroma_internal.cpp.
uint16_t PixieChroma::uv | ( | float | x, |
float | y, | ||
bool | wrap = false |
||
) |
This wrapper function returns the 1D color_map / mask index of a given OpenGL-style UV coordinate in the display matrix.
See xy(). UV Map:
+-------------------+ |0, 1 1, 1| | | |^ | | | |0, 0 > 1, 0| +-------------------+
x | Floating-point UV X coordinate |
y | Floating-point UV Y coordinate |
wrap | Enable wrapping function [optional] |
Definition at line 1586 of file pixie_chroma_internal.cpp.
float PixieChroma::get_uv_x | ( | int32_t | x_pixel | ) |
Returns the X-axis UV coordinate for a given X-axis pixel position.
x_pixel | X-axis pixel position |
Definition at line 1618 of file pixie_chroma_internal.cpp.
float PixieChroma::get_uv_y | ( | int32_t | y_pixel | ) |
Returns the Y-axis UV coordinate for a given Y-axis pixel position.
y_pixel | Y-axis pixel position |
Definition at line 1630 of file pixie_chroma_internal.cpp.
void PixieChroma::draw_line | ( | int16_t | x1, |
int16_t | y1, | ||
int16_t | x2, | ||
int16_t | y2 | ||
) |
Draws a line in the mask buffer using Bresenham's line algorithm.
x1 | Starting X coordinate of the line |
y1 | Starting Y coordinate of the line |
x2 | Ending X coordinate of the line ( inclusive ) |
y2 | Ending Y coordinate of the line ( inclusive ) |
Definition at line 1741 of file pixie_chroma_internal.cpp.
void PixieChroma::print_xy_table | ( | ) |
Prints the index table for the calculated XY map. Requires Serial.begin() first to function.
Useful for debugging, the index table (XY Map) can be printed over Serial. Each cell of the table denotes at what index that physical pixel location is inside of the 1D color_map / mask arrays. (The xy() function uses this table to translate real-world 2D coordinates to 1D indices.)
For example, here is the XY Table for a single Pixie:
70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 |
84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 |
98 | 0 | 1 | 2 | 3 | 4 | 99 | 100 | 35 | 36 | 37 | 38 | 39 | 101 |
102 | 5 | 6 | 7 | 8 | 9 | 103 | 104 | 40 | 41 | 42 | 43 | 44 | 105 |
106 | 10 | 11 | 12 | 13 | 14 | 107 | 108 | 45 | 46 | 47 | 48 | 49 | 109 |
110 | 15 | 16 | 17 | 18 | 19 | 111 | 112 | 50 | 51 | 52 | 53 | 54 | 113 |
114 | 20 | 21 | 22 | 23 | 24 | 115 | 116 | 55 | 56 | 57 | 58 | 59 | 117 |
118 | 25 | 26 | 27 | 28 | 29 | 119 | 120 | 60 | 61 | 62 | 63 | 64 | 121 |
122 | 30 | 31 | 32 | 33 | 34 | 123 | 124 | 65 | 66 | 67 | 68 | 69 | 125 |
126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 |
140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 |
Starting from 0
at the top-left with the first visible pixel, (of the first display in the XY Table) the index increases to 69
, (the last visible pixel in the matrix) before starting to count invisible pixels at index 70
and up through 153
.
With this example table setup, the first 70 indices of color_map / mask are visible pixels, and the remaining 84 are invisible. (Simulated margin between displays)
Definition at line 1982 of file pixie_chroma_internal.cpp.
CRGB* PixieChroma::color_map |
Contains the entire color map, including "invisible" areas.
Note: Pixie Chroma uses "invisible" pixels acting as padding between displays, to allow for spatial consistency. (i.e. If a word starts to scroll off the left side of one display, it will enter an "invisible" margin before it arrives on the next display.
X = Visible . = Invisible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X X X X X . . X X X X X . . X X X X X . . X X X X X . . X X X X X . . X X X X X . . X X X X X . . X X X X X . . X X X X X . . X X X X X . . X X X X X . . X X X X X . . X X X X X . . X X X X X . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Definition at line 163 of file pixie_chroma_internal.h.
uint8_t* PixieChroma::mask |
Contains the entire mask, including "invisible" areas.
The "mask" is used like a semi-transparent overlay over the color map. Imagine that you had a red piece of paper: if you took a marker and blacked out all areas of the paper except for a circle in the center, it would appear as if there was a red circle painted on a black paper. This is essentially what the mask here is doing: subtracting from the output of the color map, to show text or icons.
Note: Pixie Chroma uses "invisible" pixels acting as padding between displays, to allow for spatial consistency. (i.e. If a word starts to scroll off the left side of one display, it will enter an "invisible" margin before it arrives on the next display. (See CRGB *color_map
.)
Definition at line 182 of file pixie_chroma_internal.h.
CRGBPalette16 PixieChroma::current_palette |
The current FastLED CRGBPalette16 used for animations.
Definition at line 188 of file pixie_chroma_internal.h.
uint16_t PixieChroma::matrix_width |
Stores the final width of the matrix, including invisible pixels.
Definition at line 194 of file pixie_chroma_internal.h.
uint16_t PixieChroma::matrix_height |
Stores the final height of the matrix, including invisible pixels.
Definition at line 200 of file pixie_chroma_internal.h.
uint16_t PixieChroma::NUM_PIXELS |
Stores the total number of pixels, including invisible pixels.
This is calculated for you with the display size given to begin().
Definition at line 208 of file pixie_chroma_internal.h.
uint16_t PixieChroma::NUM_LEDS |
Stores the total number of physical LEDs, not including invisible pixels. This is calculated for you during begin() with an internal function, calc_xy().
Definition at line 215 of file pixie_chroma_internal.h.
float PixieChroma::delta = 1.0 |
Used by animation functions as a way of self-regulating speed if performance drops, similar to a game engine.
Definition at line 222 of file pixie_chroma_internal.h.
float PixieChroma::animation_speed = 1.0 |
Used by animation functions to scale the apparent speed of animation.
Definition at line 228 of file pixie_chroma_internal.h.
float PixieChroma::frame_rate |
Allows the user to access a live frame rate calculation (1 frame latency)
Definition at line 234 of file pixie_chroma_internal.h.