Skip to content

Rob-ot/node-rpi-rgb-led-matrix

 
 

Repository files navigation

node rpi rgb led matrix

Installation

npm install rpi-rgb-led-matrix

Usage

var board = require('rpi-rgb-led-matrix')

start(rows=32, chain=1, clearOnClose=true)

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()

Stop updating the board. Call clear() first to avoid random LEDs stuck on.

board.stop()

setPixel(x, y, r, g, b)

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(r, g, b)

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)

drawCanvas(ctx, width, height)

Draw a canvas 2d context to the board.

  • ctx - Canvas context to draw.

  • width height - size of the canvas

board.drawCanvas(ctx, 32, 16)

clear()

Set all pixels to black.

board.clear()

License

GPLv2 and some Public Domain

Based on https://github.com/hzeller/rpi-rgb-led-matrix

About

Node.js bindings for controlling one or a chain of 32x32 or 16x32 RGB LED displays using Raspberry Pi GPIO

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 90.5%
  • JavaScript 7.3%
  • Makefile 1.4%
  • Python 0.8%