n00dles / TetrisAnimation

Library to draw numbers on a LED matrix in a tetris style

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TetrisAnimation

Library to draw numbers using a tetris style

alt text

Tested using ESP8266 on RGB Led matrixes (using the PxMatrix library), but potentially works on any display that uses Adafruit GFX library

Basic Usage

See examples for more details.

//Intialise library by passing in a display
PxMATRIX display(64, 32, P_LAT, P_OE, P_A, P_B, P_C, P_D, P_E);
TetrisMatrixDraw tetris(display);

// Set the value of the library by using setTime or setNumbers

// Usage: setTime(time_string)
// time_string = time in the format "21:23"
tetris.setTime("12:34");

// Usage: setNumbers(num)
// num = Integer value. Max: 999999999 (9 digits long) Min: 0 (negative not currently supported).
tetris.setNumbers(1234);

// Draw the value

// Usage: drawNumbers(x, y, showColon)
// x = most left Pixel of the text 
// y = where blocks start falling from (will land y + 16)
// showColon = (optional) show the colon or not, defaults to false (only applicaple when using setTime)
tetris.drawNumbers(16,8, true);

About

Library to draw numbers on a LED matrix in a tetris style

License:GNU General Public License v3.0


Languages

Language:C++ 69.3%Language:C 30.7%