npm install rpi-rgb-led-matrix
var board = require('rpi-rgb-led-matrix')
Start updating the board.
-
rows - Vertical height of the board
-
chain - Number of boards chained together
-
clearOnClose - Automatically clear the display when node is shutting down
board.start(16, 1, true)
Stop updating the board. Call clear()
first to avoid random LEDs stuck on.
board.stop()
Set the color of a pixel. Black = off.
-
x y - Coordinates of the pixel, from the top left.
-
r g b - Red, Green, and Blue, numbers between or exactly 0 and 255
board.setPixel(2, 4, 255, 255, 0)
Fill the entire board with a solid color.
- r g b - Red, Green, and Blue, numbers between or exactly 0 and 255
board.fill(255, 255, 0)
Draw a canvas 2d context to the board.
-
ctx - Canvas context to draw.
-
width height - size of the canvas
board.drawCanvas(ctx, 32, 16)
Set all pixels to black.
board.clear()
GPLv2 and some Public Domain