Pixie pix(uint8_t pixie_count, uint8_t CLK_pin, uint8_t DAT_pin, uint8_t type = LEGACY)
Pixie class instance initializer. (pixie_count is the number of Pixies in the chain)
"pix" is the nickname for the instance, and will be used throughout the rest of your code. For example: pix.write("Hello");
"type" can be LEGACY or PRO, and should match your Pixie model/firmware being used.
Must be called after #include "Pixie.h" and before setup()
begin(uint8_t speed = LEGACY_SPEED)
Initializes the display buffer and clears the displays
(Should be called once in the Arduino setup() function)
"speed" can either be omitted/LEGACY_SPEED (39kHz) or FULL_SPEED (67kHz Pixie 1.1, 143KHz Pixie PRO).
This setting changes the bitrate the displays are updated with. Only Pixies with firmware version 1.1.0+ are compatible with FULL_SPEED, 1.0.* versions may have a glitchy display unless reflashed to 1.1.0+ to work at FULL_SPEED.
Unless you're running more than 6 Pixies in a chain (12 displays) LEGACY_SPEED is still plenty fast!
clear()
Clears the display buffer
show()
Writes the current display buffer to the Pixie chain
write(var input, uint8_t pos = 0)
Writes the input to the display at the position from the left side of the chain
"var" can be: uint8_t, uint16_t, uint32_t, int16_t, int32_t, float, double, char or char*
write(uint8_t input*, uint8_t pos = 0)
Writes a built-in Pixie Icon to the display at the position from the left side of the chain
Example: pix.write(PIX_HEART, 0);
Built-in icons can be found in the
ICON GENERATOR
write(uint8_t col0, uint8_t col1, uint8_t col2, uint8_t col3, uint8_t col4, uint8_t pos = 0)
Writes a custom Pixie Icon to the display (encoded as column data) at the position from the left side of the chain
Example: pix.write(0x10,0x26,0x20,0x26,0x10, 0);
Custom icons can be made in the
ICON GENERATOR
print(var input)
Prints the input to the display starting at the cursor index, which is 0 after a clear() call, or the first unaffected display after a write() call. Increments the cursor index, meaning calls to print() can be chained to concatenate strings, numbers and icons.
"var" can be: uint8_t, uint16_t, uint32_t, int16_t, int32_t, float, double, char or char*
print(uint8_t input*, uint8_t pos = 0)
Prints a built-in Pixie Icon to the display starting at the cursor index, which is 0 after a clear() call, or the first unaffected display after a write() call. Increments the cursor index, meaning calls to print() can be chained to concatenate strings, numbers and icons.
Example: pix.print(PIX_HEART, 0);
Built-in icons can be found in the
ICON GENERATOR
write(uint8_t col0, uint8_t col1, uint8_t col2, uint8_t col3, uint8_t col4, uint8_t pos = 0)
Prints a custom Pixie Icon to the display (encoded as column data) starting at the cursor index, which is 0 after a clear() call, or the first unaffected display after a write() call. Increments the cursor index, meaning calls to print() can be chained to concatenate strings, numbers and icons.
Example: pix.print(0x10,0x26,0x20,0x26,0x10, 0);
Custom icons can be made in the
ICON GENERATOR
push(var input)
Adds the var to the RIGHT side of the display chain, shifting all content LEFT.
"var" can be: uint8_t, uint16_t, uint32_t, int16_t, int32_t, float, double, char or char*
push(uint8_t input*, uint8_t pos = 0)
Adds a built-in Pixie Icon to the RIGHT side of the display chain, shifting all content LEFT.
Example: pix.push(PIX_HEART, 0);
Built-in icons can be found in the
ICON GENERATOR
push(uint8_t col0, uint8_t col1, uint8_t col2, uint8_t col3, uint8_t col4, uint8_t pos = 0)
Adds a custom Pixie Icon to the RIGHT side of the display buffer, (encoded as column data) shifting all content LEFT.
Example: pix.push(0x10,0x26,0x20,0x26,0x10, 0);
Custom icons can be made in the
ICON GENERATOR
push_byte(uint8_t col)
Adds a single column to the RIGHT side of the display buffer, shifting all content LEFT.
shift(var input)
Adds the var to the LEFT side of the display buffer, shifting all content RIGHT.
"var" can be: uint8_t, uint16_t, uint32_t, int16_t, int32_t, float, double, char or char*
shift(uint8_t input*, uint8_t pos = 0)
Adds a built-in Pixie Icon to the LEFT side of the display buffer, shifting all content RIGHT.
Example: pix.shift(PIX_HEART, 0);
Built-in icons can be found in the
ICON GENERATOR
shift(uint8_t col0, uint8_t col1, uint8_t col2, uint8_t col3, uint8_t col4, uint8_t pos = 0)
Adds a custom Pixie Icon to the LEFT side of the display buffer, (encoded as column data) shifting all content RIGHT.
Example: pix.shift(0x10,0x26,0x20,0x26,0x10, 0);
Custom icons can be made in the
ICON GENERATOR
shift_byte(uint8_t col)
Adds a single column to the LEFT side of the display buffer, shifting all content RIGHT.
scroll_message(char* input, uint16_t wait_ms = 100, bool instant = false)
Blocking function that scrolls a string right to left, stopping at each display for wait_ms, or skipping the scrolling animation if instant == true.
draw_line(int16_t x1, int16_t y1, int16_t x2, int16_t y2)
Draws a line using Bresenham's line algorithm. Uses set_pix() internally
Note: These coordinates include the three columns of "dead space" between displays, meaning (0,0) is off-screen. Please refer to the HARDWARE DATASHEET (P.5-S.10) to see how dead-space in the internal display buffer is handled.
set_pix(uint16_t x, uint16_t y, bool state)
Sets the pixel at (x,y) to boolean state.
Note: These coordinates include the three columns of "dead space" between displays, meaning (0,0) is off-screen. Please refer to the HARDWARE DATASHEET (P.5-S.10) to see how dead-space in the internal display buffer is handled.
set_cursor(uint8_t position)
Sets the print() cursor to the index specified. 0 is the leftmost display.
brightness(uint8_t level)
Sets the display chain to a 7-bit brightness level between 0 and 127. Uses write_brightness() internally.
write_brightness(uint8_t level, uint8_t pos)
Sets the display at pos to a 7-bit brightness level between 0 and 127.
dump_buffer()
Prints all binary bits of the internal display buffer over Serial.
Your code must call Serial.begin(baud_rate); before dump_buffer() is called.
reset()
Drives the CLK pin high for 10ms, then LOW to reset all Pixies in the chain.