81 chars_x = pixies_x * 2;
95 color_map_out =
new CRGB[
NUM_LEDS ];
98 for( uint16_t i = 0; i <
NUM_LEDS; i++ ){
104 build_controller( pixie_pin );
197 chars_x = pixies_x * 2;
211 color_map_out =
new CRGB[
NUM_LEDS ];
214 for( uint16_t i = 0; i <
NUM_LEDS; i++ ){
220 #if defined( ARDUINO_ARCH_ESP8266 )
222 FastLED.addLeds<WS2811_PORTA,4>( color_map_out, pixies_per_pin * leds_per_pixie ).setCorrection( TypicalLEDStrip );
225 #if defined( ARDUINO_ARCH_ESP32 )
228 FastLED.addLeds<NEOPIXEL, 13>(
231 ( pixies_per_pin*leds_per_pixie )
232 ).setCorrection( TypicalLEDStrip );
234 FastLED.addLeds<NEOPIXEL, 12>(
236 ( pixies_per_pin*leds_per_pixie ),
237 ( pixies_per_pin*leds_per_pixie )
238 ).setCorrection( TypicalLEDStrip );
240 FastLED.addLeds<NEOPIXEL, 14>(
242 ( pixies_per_pin*leds_per_pixie ) * 2,
243 ( pixies_per_pin*leds_per_pixie )
244 ).setCorrection( TypicalLEDStrip );
246 FastLED.addLeds<NEOPIXEL, 27>(
248 ( pixies_per_pin*leds_per_pixie ) * 4,
249 ( pixies_per_pin*leds_per_pixie )
250 ).setCorrection( TypicalLEDStrip );
268 brightness_level = level;
342 correct_gamma = enabled;
392 cursor_x = display_padding_x + ( display_width * x_position );
393 cursor_y = display_padding_y + ( display_height * y_position );
477 if( mode ==
AUTOMATIC && ticker_running ==
false ){
479 animate.attach_ms( round(1000 /
float(FPS)), [
this](){ this->
show(); });
486 ticker_running =
true;
488 else if( mode ==
MANUAL && ticker_running ==
true ){
490 ticker_running =
false;
506 display_padding_x + ( display_width * x_pos ),
507 display_padding_y + ( display_height * y_pos )
546 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, uint8_t y_pos ){
554 write( icon, x_pos, y_pos );
569 display_padding_x + ( display_width * x_pos ),
570 display_padding_y + ( display_height * y_pos )
585 itoa( input, char_buf, 10 );
589 display_padding_x + ( display_width * x_pos ),
590 display_padding_y + ( display_height * y_pos )
605 utoa( input, char_buf, 10 );
609 display_padding_x + ( display_width * x_pos ),
610 display_padding_y + ( display_height * y_pos )
625 ltoa( input, char_buf, 10 );
629 display_padding_x + ( display_width * x_pos ),
630 display_padding_y + ( display_height * y_pos )
645 ultoa( input, char_buf, 10 );
649 display_padding_x + ( display_width * x_pos ),
650 display_padding_y + ( display_height * y_pos )
666 ultoa( input, char_buf, 10 );
670 display_padding_x + ( display_width * x_pos ),
671 display_padding_y + ( display_height * y_pos )
688 dtoa( input, char_buf, places );
692 display_padding_x + ( display_width * x_pos ),
693 display_padding_y + ( display_height * y_pos )
754 int16_t offset_x = 0;
755 int16_t offset_y = 0;
757 uint8_t len = strlen( message );
758 for( uint8_t i = 0; i < len; i++ ){
759 if( message[i] ==
'\n' ){
760 x_dest = display_padding_x;
762 offset_y = display_height;
764 else if( line_wrap ==
true && x_dest+offset_x >= ( display_width * chars_x ) ){
765 x_dest = display_padding_x;
767 offset_y = display_height;
774 offset_x += display_width;
776 else if( message[i] == 0 || message[i] ==
'\0' ){
785 offset_x += display_width;
789 cursor_x_temp = x_dest+offset_x;
790 cursor_y_temp = y_dest+offset_y;
812 uint8_t column = pgm_read_byte( font + ( chr *
font_col_width + x ) );
814 uint16_t row1_index =
xy( x_dest+x, y_dest+0 );
815 uint16_t row2_index =
xy( x_dest+x, y_dest+1 );
816 uint16_t row3_index =
xy( x_dest+x, y_dest+2 );
817 uint16_t row4_index =
xy( x_dest+x, y_dest+3 );
818 uint16_t row5_index =
xy( x_dest+x, y_dest+4 );
819 uint16_t row6_index =
xy( x_dest+x, y_dest+5 );
820 uint16_t row7_index =
xy( x_dest+x, y_dest+6 );
823 mask[row1_index] = qadd8(
mask[row1_index], bit_table[bitRead( column, 0 )] );
824 mask[row2_index] = qadd8(
mask[row2_index], bit_table[bitRead( column, 1 )] );
825 mask[row3_index] = qadd8(
mask[row3_index], bit_table[bitRead( column, 2 )] );
826 mask[row4_index] = qadd8(
mask[row4_index], bit_table[bitRead( column, 3 )] );
827 mask[row5_index] = qadd8(
mask[row5_index], bit_table[bitRead( column, 4 )] );
828 mask[row6_index] = qadd8(
mask[row6_index], bit_table[bitRead( column, 5 )] );
829 mask[row7_index] = qadd8(
mask[row7_index], bit_table[bitRead( column, 6 )] );
844 uint8_t column = pgm_read_byte_far( icon+x );
846 uint16_t row1_index =
xy( x_dest+x, y_dest+0 );
847 uint16_t row2_index =
xy( x_dest+x, y_dest+1 );
848 uint16_t row3_index =
xy( x_dest+x, y_dest+2 );
849 uint16_t row4_index =
xy( x_dest+x, y_dest+3 );
850 uint16_t row5_index =
xy( x_dest+x, y_dest+4 );
851 uint16_t row6_index =
xy( x_dest+x, y_dest+5 );
852 uint16_t row7_index =
xy( x_dest+x, y_dest+6 );
855 mask[row1_index] = qadd8(
mask[row1_index], bit_table[bitRead( column,0 )] );
856 mask[row2_index] = qadd8(
mask[row2_index], bit_table[bitRead( column,1 )] );
857 mask[row3_index] = qadd8(
mask[row3_index], bit_table[bitRead( column,2 )] );
858 mask[row4_index] = qadd8(
mask[row4_index], bit_table[bitRead( column,3 )] );
859 mask[row5_index] = qadd8(
mask[row5_index], bit_table[bitRead( column,4 )] );
860 mask[row6_index] = qadd8(
mask[row6_index], bit_table[bitRead( column,5 )] );
861 mask[row7_index] = qadd8(
mask[row7_index], bit_table[bitRead( column,6 )] );
876 cursor_x = cursor_x_temp;
877 cursor_y = cursor_y_temp;
913 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 ){
914 cursor_x_temp = cursor_x;
915 cursor_y_temp = cursor_y;
916 const uint8_t icon[5] = {
926 cursor_x = cursor_x_temp;
927 cursor_y = cursor_y_temp;
938 write_pix( message, cursor_x, cursor_y );
941 cursor_x = cursor_x_temp;
942 cursor_y = cursor_y_temp;
945 cursor_x = cursor_x_temp;
946 cursor_y = cursor_y_temp;
959 itoa( input, char_buf, 10 );
960 write_pix( char_buf, cursor_x, cursor_y );
963 cursor_x = cursor_x_temp;
964 cursor_y = cursor_y_temp;
977 utoa( input, char_buf, 10 );
978 write_pix( char_buf, cursor_x, cursor_y );
981 cursor_x = cursor_x_temp;
982 cursor_y = cursor_y_temp;
995 ltoa( input, char_buf, 10 );
996 write_pix( char_buf, cursor_x, cursor_y );
999 cursor_x = cursor_x_temp;
1000 cursor_y = cursor_y_temp;
1013 ultoa( input, char_buf, 10 );
1014 write_pix( char_buf, cursor_x, cursor_y );
1017 cursor_x = cursor_x_temp;
1018 cursor_y = cursor_y_temp;
1031 ultoa( input, char_buf, 10 );
1032 write_pix( char_buf, cursor_x, cursor_y );
1035 cursor_x = cursor_x_temp;
1036 cursor_y = cursor_y_temp;
1050 dtoa( input, char_buf, places );
1051 write_pix( char_buf, cursor_x, cursor_y );
1054 cursor_x = cursor_x_temp;
1055 cursor_y = cursor_y_temp;
1068 print(
double( input ), places );
1071 cursor_x = cursor_x_temp;
1072 cursor_y = cursor_y_temp;
1087 cursor_x = cursor_x_temp;
1088 cursor_y = cursor_y_temp;
1090 cursor_x = display_padding_x;
1091 cursor_y += display_height;
1107 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 ){
1108 const uint8_t icon[5] = {
1118 cursor_x = cursor_x_temp;
1119 cursor_y = cursor_y_temp;
1121 cursor_x = display_padding_x;
1122 cursor_y += display_height;
1135 write_pix( message, cursor_x, cursor_y );
1138 cursor_x = display_padding_x;
1139 cursor_y = cursor_y_temp;
1140 cursor_y += display_height;
1154 itoa( input, char_buf, 10 );
1169 utoa( input, char_buf, 10 );
1184 ltoa( input, char_buf, 10 );
1199 ultoa( input, char_buf, 10 );
1214 ultoa( input, char_buf, 10 );
1231 dtoa( input, char_buf, places );
1247 println(
double(input), places );
1270 uint8_t keep = 255 - blur_amount;
1271 uint8_t seep = blur_amount >> 1;
1273 uint8_t carryover = 0;
1275 uint8_t cur =
mask[
xy( i,row )];
1277 part = scale8( part, seep );
1278 cur = scale8( cur, keep );
1279 cur = qadd8( cur,carryover );
1281 mask[
xy( i-1,row )] = qadd8(
mask[
xy( i-1,row )],part );
1298 uint8_t keep = 255 - blur_amount;
1299 uint8_t seep = blur_amount >> 1;
1301 uint8_t carryover = 0;
1303 uint8_t cur =
mask[
xy( col,i )];
1305 part = scale8( part, seep );
1306 cur = scale8( cur, keep );
1307 cur = qadd8( cur,carryover );
1309 mask[
xy( col,i-1 )] = qadd8(
mask[
xy( col,i-1 )],part );
1331 for( uint16_t i = 0; i <
NUM_PIXELS; i+=11 ){
1332 mask[i+0] = scale8(
mask[i+0], 255-amount );
1333 mask[i+1] = scale8(
mask[i+1], 255-amount );
1334 mask[i+2] = scale8(
mask[i+2], 255-amount );
1335 mask[i+3] = scale8(
mask[i+3], 255-amount );
1336 mask[i+4] = scale8(
mask[i+4], 255-amount );
1337 mask[i+5] = scale8(
mask[i+5], 255-amount );
1338 mask[i+6] = scale8(
mask[i+6], 255-amount );
1339 mask[i+7] = scale8(
mask[i+7], 255-amount );
1340 mask[i+8] = scale8(
mask[i+8], 255-amount );
1341 mask[i+9] = scale8(
mask[i+9], 255-amount );
1342 mask[i+10] = scale8(
mask[i+10], 255-amount );
1366 uint8_t keep = 255 - blur_amount;
1367 uint8_t seep = blur_amount >> 1;
1369 uint8_t carryover = 0;
1373 part.nscale8( seep );
1374 cur.nscale8( keep );
1392 uint8_t keep = 255 - blur_amount;
1393 uint8_t seep = blur_amount >> 1;
1395 CRGB carryover = CRGB::Black;
1399 part.nscale8( seep );
1400 cur.nscale8( keep );
1418 leds_temp.fadeToBlackBy( amount );
1429 return cursor_x / chars_x;
1440 return cursor_y / chars_y;
1671 int16_t x_pos = x * display_width + display_padding_x;
1672 int16_t y_pos = y * display_height + display_padding_y;
1705 if( x2 < x1 || y2 < y1 ){
1713 int16_t x1_pos = x1 * display_width + display_padding_x;
1714 int16_t y1_pos = y1 * display_height + display_padding_y;
1716 int16_t x2_pos = x2 * display_width + display_padding_x;
1717 int16_t y2_pos = y2 * display_height + display_padding_y;
1719 uint16_t x_delta = x2_pos - x1_pos;
1720 uint16_t y_delta = y2_pos - y1_pos;
1722 for( uint16_t y = 0; y < y_delta; y++ ){
1723 for( uint16_t x = 0; x < x_delta; x++ ){
1724 int16_t x2_pos = x1_pos + x;
1725 int16_t y2_pos = y1_pos + y;
1745 int16_t x,y,dx,dy,dx1,dy1,px,py,xe,ye,i;
1764 mask[index] = qadd8( 255,
mask[index] );
1765 for( i=0;x<xe;i++ ){
1771 if( ( dx<0 && dy<0 ) || ( dx>0 && dy>0 ) ){
1777 px=px+2*( dy1-dx1 );
1781 mask[index] = qadd8( 255,
mask[index] );
1796 mask[index] = qadd8( 255,
mask[index] );
1797 for( i=0;y<ye;i++ ){
1803 if( ( dx<0 && dy<0 ) || ( dx>0 && dy>0 ) ){
1809 py=py+2*( dx1-dy1 );
1812 mask[index] = qadd8( 255,
mask[index] );
1846 _temperature = constrain( temperature, 0, 65500 );
1848 _red = _green = _blue = 0;
1849 float t = _temperature * 0.01;
1853 _green = ( 99.4708025861 * log( t ) ) - 161.1195681661;
1855 _blue = ( 138.5177312231 * log( t - 10 ) ) - 305.0447927307;
1862 _red = 329.698727466 * pow( t - 60, -0.1332047592 );
1863 _green = 288.1221695283 * pow( t - 60, -0.0755148492 );
1867 float f = 0.01 * 100;
1869 _red = constrain( f * _red, 0, 255 );
1870 _green = constrain( f * _green, 0, 255 );
1871 _blue = constrain( f * _blue, 0, 255 );
1873 return CRGB( _red, _green, _blue );
1908 uint32_t t_now = micros();
1909 float frame_delta_us = t_now-t_last;
1923 for( uint16_t i = 0; i <
NUM_LEDS; i++ ){
1925 color_map_out[i].fadeLightBy( 255-mask_out[i] );
1928 if( correct_gamma ){
1929 color_map_out[i].r =
gamma8[ color_map_out[i].r ];
1930 color_map_out[i].g =
gamma8[ color_map_out[i].g ];
1931 color_map_out[i].b =
gamma8[ color_map_out[i].b ];
1936 FastLED.setBrightness( calculate_max_brightness_for_power_vmA( color_map_out,
NUM_LEDS, brightness_level, max_V, max_mA ) );
1986 Serial.print( xy_table[index] );
1987 Serial.print(
'\t' );
1997 void PixieChroma::build_controller(
const uint8_t pin ){
2004 if ( pin == 0 ){FastLED.addLeds<WS2812B, 0, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2005 if ( pin == 1 ){FastLED.addLeds<WS2812B, 1, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2006 if ( pin == 2 ){FastLED.addLeds<WS2812B, 2, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2007 if ( pin == 3 ){FastLED.addLeds<WS2812B, 3, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2008 if ( pin == 4 ){FastLED.addLeds<WS2812B, 4, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2009 if ( pin == 5 ){FastLED.addLeds<WS2812B, 5, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2011 if ( pin == 12 ){FastLED.addLeds<WS2812B, 12, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2012 if ( pin == 13 ){FastLED.addLeds<WS2812B, 13, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2013 if ( pin == 14 ){FastLED.addLeds<WS2812B, 14, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2014 if ( pin == 15 ){FastLED.addLeds<WS2812B, 15, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2015 if ( pin == 16 ){FastLED.addLeds<WS2812B, 16, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2019 if ( pin == 0 ){FastLED.addLeds<WS2812B, 0, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2020 if ( pin == 1 ){FastLED.addLeds<WS2812B, 1, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2021 if ( pin == 2 ){FastLED.addLeds<WS2812B, 2, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2022 if ( pin == 3 ){FastLED.addLeds<WS2812B, 3, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2023 if ( pin == 4 ){FastLED.addLeds<WS2812B, 4, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2024 if ( pin == 5 ){FastLED.addLeds<WS2812B, 5, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2025 if ( pin == 12 ){FastLED.addLeds<WS2812B, 12, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2026 if ( pin == 13 ){FastLED.addLeds<WS2812B, 13, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2027 if ( pin == 14 ){FastLED.addLeds<WS2812B, 14, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2028 if ( pin == 15 ){FastLED.addLeds<WS2812B, 15, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2029 if ( pin == 16 ){FastLED.addLeds<WS2812B, 16, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2030 if ( pin == 17 ){FastLED.addLeds<WS2812B, 17, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2031 if ( pin == 18 ){FastLED.addLeds<WS2812B, 18, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2032 if ( pin == 19 ){FastLED.addLeds<WS2812B, 19, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2033 if ( pin == 21 ){FastLED.addLeds<WS2812B, 21, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2034 if ( pin == 22 ){FastLED.addLeds<WS2812B, 22, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2035 if ( pin == 23 ){FastLED.addLeds<WS2812B, 23, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2036 if ( pin == 25 ){FastLED.addLeds<WS2812B, 25, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2037 if ( pin == 26 ){FastLED.addLeds<WS2812B, 26, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2038 if ( pin == 27 ){FastLED.addLeds<WS2812B, 27, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2039 if ( pin == 32 ){FastLED.addLeds<WS2812B, 32, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2040 if ( pin == 33 ){FastLED.addLeds<WS2812B, 33, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2044 if ( pin == 0 ){FastLED.addLeds<WS2812B, 0, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2045 if ( pin == 1 ){FastLED.addLeds<WS2812B, 1, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2046 if ( pin == 2 ){FastLED.addLeds<WS2812B, 2, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2047 if ( pin == 3 ){FastLED.addLeds<WS2812B, 3, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2048 if ( pin == 4 ){FastLED.addLeds<WS2812B, 4, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2049 if ( pin == 5 ){FastLED.addLeds<WS2812B, 5, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2050 if ( pin == 6 ){FastLED.addLeds<WS2812B, 6, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2051 if ( pin == 7 ){FastLED.addLeds<WS2812B, 7, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2052 if ( pin == 8 ){FastLED.addLeds<WS2812B, 8, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2053 if ( pin == 9 ){FastLED.addLeds<WS2812B, 9, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2054 if ( pin == 10 ){FastLED.addLeds<WS2812B, 10, GRB>( color_map_out,
NUM_LEDS ).setCorrection( TypicalLEDStrip );}
2059 void PixieChroma::calc_xy(){
2061 for( uint16_t yi = 0; yi < chars_y; yi++ ){
2062 for( uint16_t y = 0; y < 11; y++ ){
2063 for( uint16_t xi = 0; xi < chars_x; xi++ ){
2064 for( uint16_t x = 0; x < 7; x++ ){
2065 int16_t x_pos = ( xi*display_width )+x;
2066 int16_t y_pos = ( yi*display_height )+y;
2068 int16_t x_pos_mod = x_pos % display_width;
2069 int16_t y_pos_mod = y_pos % display_height;
2072 uint16_t i_template = ( y_pos_mod * display_width ) + x_pos_mod;
2074 xy_table[i_table] = int8_t( pgm_read_byte( xy_template + i_template ) );
2083 uint8_t visible_rows = 0;
2084 for( uint16_t row = 0; row < display_height; row++ ){
2085 uint16_t index = ( 5*visible_rows );
2086 bool found_visible =
false;
2087 int16_t last_data = 0;
2090 int16_t map_data = xy_table[i];
2092 if( map_data == -1 ){
2093 xy_table[i] = index;
2095 found_visible =
true;
2098 else if( map_data == -2 ){
2099 if( last_data == -1 ){
2104 last_data = map_data;
2107 if( found_visible ){
2116 uint8_t rows_left = chars_y-1;
2117 uint16_t row_length = ( display_width*display_height )*chars_x;
2118 for( uint8_t ii = 0; ii < rows_left; ii++ ){
2119 for( uint16_t r = 0; r < row_length; r++ ){
2120 uint16_t final_src_index = ( ii*row_length )+r;
2121 int16_t src_data = xy_table[final_src_index];
2122 if( src_data >= 0 ){
2123 src_data += ( 35*chars_x );
2128 xy_table[final_src_index+row_length] = src_data;
2140 uint16_t j = xy_table[i];
2142 if( xy_table[i] == -2 ){
2143 xy_table[i] = index;
This is the software documentation for using Pixie Chroma functions on Arduino! For full example usag...
uint16_t NUM_PIXELS
Stores the total number of pixels, including invisible pixels.
void color_blur(fract8 blur_amount)
Blurs the color buffer in both axes by blur_amount.
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.
void color(CRGB col)
Sets the entire color buffer to a CRGB value.
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 Pixi...
float animation_speed
Used by animation functions to scale the apparent speed of animation.
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.
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.
void add_char(char c, int16_t x_pos, int16_t y_pos)
Internal function for rendering a single char to the mask buffer.
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 print(const uint8_t *icon)
Prints an Icon to the displays, at the current cursor position.
void free()
Unfreezes the current mask buffer in memory to allow showing updated text the next time show() is cal...
void blur(fract8 blur_amount)
Blurs the mask buffer in both axes by blur_amount.
void set_animation(void(*action)(PixieChroma *, float))
Accepts a preset or custom function to use for the animation ISR.
void clear()
Clears (blackens) the current mask buffer and resets the cursor to 0,0.
uint16_t NUM_LEDS
Stores the total number of physical LEDs, not including invisible pixels. This is calculated for you ...
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.
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 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.
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.
void color_blur_x(fract8 blur_amount)
Blurs the color buffer in the X axis by blur_amount.
void set_animation_speed(float speed)
Used to scale the animation speed of animation ISRs that can use pix.animation_speed() to scale their...
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.
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 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 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.
void hold()
Freezes the current mask buffer in memory to prevent showing unfinished text if show() automaticall f...
const uint8_t printable_ascii_offset
Constant defining the offset into the ASCII table that printable characters begin.
const uint8_t font_col_width
Constant defining the width of a character.
char * dtoa(double input, char *buffer, int precision)
Homebrew C function to convert double precision floats to char*. (Arduino Forum link)
const uint8_t gamma8[]
Used as a fast lookup table for gamma correction.
void(* anim_func)(PixieChroma *_p, float delta)
Used to store the pointer to any preset/custom animation functions the library needs to call during s...