48 void begin(
const uint8_t data_pin, uint8_t pixies_x, uint8_t pixies_y );
49 void begin_quad( uint8_t pixies_per_pin, uint8_t pixies_x, uint8_t pixies_y );
65 void add_char(
char chr, int16_t x_pos, int16_t y_pos );
66 void add_char( uint8_t bitmap_col_1, uint8_t bitmap_col_2, uint8_t bitmap_col_3, uint8_t bitmap_col_4, uint8_t bitmap_col_5, int16_t x_pos, int16_t y_pos );
67 void write( uint8_t bitmap_col_1, uint8_t bitmap_col_2, uint8_t bitmap_col_3, uint8_t bitmap_col_4, uint8_t bitmap_col_5, uint8_t x_pos = 0, uint8_t y_pos = 0 );
68 void write(
char* message, uint8_t x_pos = 0, uint8_t y_pos = 0 );
69 void write( int16_t input, uint8_t x_pos = 0, uint8_t y_pos = 0 );
70 void write( uint16_t input, uint8_t x_pos = 0, uint8_t y_pos = 0 );
71 void write( int32_t input, uint8_t x_pos = 0, uint8_t y_pos = 0 );
72 void write( uint32_t input, uint8_t x_pos = 0, uint8_t y_pos = 0 );
73 #ifndef ARDUINO_ARCH_TEENSY_3_X
74 void write(
long unsigned int input, uint8_t x_pos = 0, uint8_t y_pos = 0 );
76 void write(
float input, uint8_t places = 2, uint8_t x_pos = 0, uint8_t y_pos = 0 );
77 void write(
double input, uint8_t places = 2, uint8_t x_pos = 0, uint8_t y_pos = 0 );
79 void write_pix(
char* message, int16_t x_offset = 0, int16_t y_offset = 0 );
80 void write_pix( uint8_t bitmap_col_1, uint8_t bitmap_col_2, uint8_t bitmap_col_3, uint8_t bitmap_col_4, uint8_t bitmap_col_5, int16_t x_dest = 0, int16_t y_dest = 0 );
85 void print( uint8_t bitmap_col_1, uint8_t bitmap_col_2, uint8_t bitmap_col_3, uint8_t bitmap_col_4, uint8_t bitmap_col_5 );
86 void print(
char chr );
87 void print(
char* message );
88 void print( int16_t input );
89 void print( uint16_t input );
90 void print( int32_t input );
91 void print( uint32_t input );
92 #ifndef ARDUINO_ARCH_TEENSY_3_X
93 void print(
long unsigned int input );
95 void print(
float input, uint8_t places = 2 );
96 void print(
double input, uint8_t places = 2 );
100 void println( uint8_t bitmap_col_1, uint8_t bitmap_col_2, uint8_t bitmap_col_3, uint8_t bitmap_col_4, uint8_t bitmap_col_5 );
103 void println( uint16_t input );
105 void println( uint32_t input );
106 #ifndef ARDUINO_ARCH_TEENSY_3_X
107 void println(
long unsigned int input );
109 void println(
float input, uint8_t places = 2 );
110 void println(
double input, uint8_t places = 2 );
118 void set_cursor( uint8_t x_position, uint8_t y_position = 0 );
126 void delay(uint32_t milliseconds);
130 void color( CRGB col );
131 void color( CRGB col, uint8_t x, uint8_t y );
132 void color( CRGB col, int16_t x1, int16_t y1, int16_t x2, int16_t y2 );
138 void blur( fract8 blur_amount );
139 void blur_x( fract8 blur_amount );
140 void blur_y( fract8 blur_amount );
141 void dim( uint8_t amount,
bool reset_cursor =
false );
153 void draw_line_mask( int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t value = 255 );
166 uint16_t
uv(
float x,
float y,
bool wrap =
false );
167 uint16_t
xy( int32_t x, int32_t y,
bool wrap =
false );
276 void build_controller(
const uint8_t pin );
278 void fetch_shortcode(
char* message, uint16_t code_start, uint16_t code_end,
bool return_code =
false );
279 void parse_custom_shortcode(
char* message, uint16_t code_start, uint16_t code_end,
bool return_code =
false );
280 int16_t calc_justification(
t_justification justification, uint8_t row );
281 void scroll_char(
char c, uint8_t row);
282 void scroll_char(uint8_t* bitmap, uint8_t row);
285 #if defined( ARDUINO_ARCH_ESP8266 ) || defined( ARDUINO_ARCH_ESP32 )
287 #elif defined( ARDUINO_ARCH_TEENSY_3_X )
288 IntervalTimer animate;
291 const uint8_t display_padding_x = 1;
292 const uint8_t display_padding_y = 2;
293 const uint8_t display_width = display_padding_x + 5 + display_padding_x;
294 const uint8_t display_height = display_padding_y + 7 + display_padding_y;
295 const uint8_t extra_space_left = display_width;
296 const uint8_t leds_per_pixie = 70;
297 const uint8_t bit_table[2] = { 0, 255 };
299 volatile int16_t cursor_x;
300 volatile int16_t cursor_y;
301 volatile int16_t cursor_x_temp;
302 volatile int16_t cursor_y_temp;
303 t_justification justifications[8] = { LEFT, LEFT, LEFT, LEFT, LEFT, LEFT, LEFT, LEFT };
304 bool scrolling[8] = {
false,
false,
false,
false,
false,
false,
false,
false };
305 uint16_t scroll_frame_delay_ms = 10;
306 uint16_t scroll_hold_ms = 80;
313 CRGB print_col = CRGB( 0, 255, 0 );
314 uint8_t temp_code[5];
317 uint16_t max_mA = 500;
318 uint8_t brightness_level = 255;
320 bool correct_gamma =
false;
321 bool line_wrap =
true;
322 bool just_wrapped =
false;
323 bool custom_animation =
false;
326 bool ticker_running =
false;
327 float fps_target = 60;
This is the software documentation for using Pixie Chroma functions on Arduino! For full example usag...
void color_blur(fract8 blur_amount)
Blurs the color buffer in both axes by blur_amount.
void set_scroll_type(t_scroll_type type)
Sets the scroll behavior:
void shift_color_map_y(int16_t amount)
Shifts the color map data by amount on the Y axis. Useful for scrolling!
void print(uint8_t bitmap_col_1, uint8_t bitmap_col_2, uint8_t bitmap_col_3, uint8_t bitmap_col_4, uint8_t bitmap_col_5)
Prints a bitmap to the displays at the current cursor position, taking five uint8_t as input for the ...
void draw_line_mask(int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t value=255)
Draws a line in the mask buffer using Bresenham's line algorithm.
void set_color_animation_speed(float speed)
Used to scale the animation speed of animation ISRs that can use pix.animation_speed() to scale their...
void color(CRGB col)
Sets the entire color buffer to a CRGB value.
float animation_speed
Used by animation functions to scale the apparent speed of animation.
void write(uint8_t bitmap_col_1, uint8_t bitmap_col_2, uint8_t bitmap_col_3, uint8_t bitmap_col_4, uint8_t bitmap_col_5, uint8_t x_pos=0, uint8_t y_pos=0)
Writes a bitmap to a specified X and Y cursor position, taking five uint8_t as input for the column d...
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.
void set_brightness(uint8_t level)
Takes an 8-bit brightness value and passes it to FastLED internally, to provide global brightness con...
PixieChroma()
Construct a Pixie Chroma class object.
void set_color_animation(void(*action)(PixieChroma *, float))
Accepts a preset Color Animation or custom function to use for the animation ISR.
void print_color(CRGB col)
All print() calls after a print_color() will be colored with this value.
float delta
Used by animation functions as a way of self-regulating speed if performance drops,...
float get_uv_y(int32_t y_pixel)
Returns the Y-axis UV coordinate for a given Y-axis pixel position.
CRGB * color_map
Contains the entire color map, including "invisible" areas.
void set_line_wrap(bool enabled)
Sets the line wrapping behavior.
uint16_t led_count
Stores the total number of physical LEDs, not including invisible pixels. This is calculated for you ...
void shift_color_map_x(int16_t amount, int16_t row=-1)
Shifts the color_map data by amount on the X axis. Useful for scrolling or justification!
void print_xy_table()
Prints the index table for the calculated XY map. Requires Serial.begin() first to function.
uint8_t * mask
Contains the entire mask, including "invisible" areas.
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 gre...
void free()
Unfreezes the current mask buffer in memory to allow showing updated text the next time show() is cal...
CRGB get_pixel_color(int32_t x, int32_t y)
Gets the RGB color value at a given pixel coordinate.
void blur(fract8 blur_amount)
Blurs the mask buffer in both axes by blur_amount.
void set_pixel_color(int32_t x, int32_t y, CRGB color)
Sets the RGB color value at a given pixel coordinate.
void println(uint8_t bitmap_col_1, uint8_t bitmap_col_2, uint8_t bitmap_col_3, uint8_t bitmap_col_4, uint8_t bitmap_col_5)
Prints a bitmap to the displays at the current cursor position, (taking five uint8_t as input for the...
void clear()
Clears (blackens) the current mask buffer and resets the cursor to 0,0.
uint16_t matrix_width
Stores the final width of the matrix, including invisible pixels.
CRGBPalette16 current_palette
The current FastLED CRGBPalette16 used for animations.
void show()
Processes 1D image data into truncated versions, sending them to the Pixie Chroma displays.
uint8_t get_pixel_mask(int32_t x, int32_t y)
Gets the mask value at a given pixel coordinate.
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 ...
uint8_t get_cursor_y()
Returns the cursor's Y position.
void blur_x(fract8 blur_amount)
Blurs the mask buffer in the X axis by blur_amount.
void shift_mask_x(int16_t amount, int16_t row=-1)
Shifts the mask data by amount on the X axis. Useful for scrolling or justification!
int16_t get_cursor_x_exact()
Returns the cursor's X position in exact pixel coordinates.
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.
float get_uv_x(int32_t x_pixel)
Returns the X-axis UV coordinate for a given X-axis pixel position.
void color_blur_y(fract8 blur_amount)
Blurs the color buffer in the Y axis by blur_amount.
bool unit_tests()
Developer use - automated unit testing of PixieChroma code.
void color_blur_x(fract8 blur_amount)
Blurs the color buffer in the X axis by blur_amount.
void draw_line_color(int16_t x1, int16_t y1, int16_t x2, int16_t y2, CRGB color)
Draws a line in the color map using Bresenham's line algorithm.
void color_dim(uint8_t amount)
Darkens the color buffer by an 8-bit amount.
void set_max_power(float volts, uint16_t milliamps)
Sets the maximum power budget in volts and milliamps.
uint16_t matrix_height
Stores the final height of the matrix, including invisible pixels.
void set_pixel_mask(int32_t x, int32_t y, uint8_t value)
Sets the mask value at a given pixel coordinate.
int16_t get_cursor_y_exact()
Returns the cursor's Y position in exact pixel coordinates.
float frame_rate
Allows the user to access a live frame rate calculation (1 frame latency)
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 c...
void set_palette(const uint8_t *pal)
Accepts a const uint8_t (8-bit) array to generate a FastLED Gradient Palette at runtime:
void dim(uint8_t amount, bool reset_cursor=false)
Darkens the mask buffer by an 8-bit amount. Optionally resets the cursor position.
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....
void set_cursor(uint8_t x_position, uint8_t y_position=0)
Sets the cursor position in a 2D context, in whole displays.
void shift_mask_y(int16_t amount)
Shifts the mask data by amount on the Y axis. Useful for scrolling!
void add_char(char chr, int16_t x_pos, int16_t y_pos)
Internal function for rendering a single char to the mask buffer.
void scroll_message(char *message, uint8_t row=0)
Scrolls a message across the matrix by constructing it one character at a time in the dead-space outs...
void set_gamma_correction(bool enabled)
Allows you to enable built-in automatic gamma correction, using a fast LUT in pixie_utility....
CRGB kelvin_to_rgb(uint16_t temperature)
Approximates the conversion of a blackbody radiation temperature (i.e. 3500K) to a CRGB color object.
void set_justification(t_justification justification, int16_t row=-1)
Sets the text justification globally, or by row.
void delay(uint32_t milliseconds)
Custom delay() function from FastLED that allows automatic refreshing of the displays during a delay(...
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 gre...
uint8_t get_cursor_x()
Returns the cursor's X position.
void blur_y(fract8 blur_amount)
Blurs the mask buffer in the Y axis by blur_amount.
uint16_t pixel_count
Stores the total number of pixels, including invisible pixels.
void hold()
Freezes the current mask buffer in memory to prevent showing unfinished text if show() automaticall f...