node-max7219-led-matrix
v1.0.0
Published
Node max7216 led matrix interfacing for raspberry pi
Downloads
5
Maintainers
Readme
node-max7219-led-matrix
Node max7216 led matrix interfacing for raspberry pi
Install
npm install node-max7219-led-matrix
Prerequisites
You'll need the SPI device to be enabled. Check this guide if it's not
The devices are successfully installed in /dev:
$ ls -l /dev/spi*
crw-rw---- 1 root spi 153, 0 Sep 20 01:17 /dev/spidev0.0
crw-rw---- 1 root spi 153, 1 Sep 20 01:17 /dev/spidev0.1
Usage
var max7219LedMatrix = require('node-max7219-led-matrix');
var max7219 = new max7219LedMatrix.max7219("/dev/spidev0.0");
max7219.letter('A');
- Constructor
max7219LedMatrix.max7219(device)
Initializes the instance. The device
argument is a string specifying the SPI device on which the controller is wired. For example, "/dev/spidev0.0"
.
setBrightness(intensity)
Set the brightness of the led. intensity
is from 0 to 15.
clear()
Clear the device display.
letter(letter, font)
Display a letter
on the display with the specific font
(optional).
Fonts are: CP437_FONT
(default), SINCLAIR_FONT
, LCD_FONT
, UKR_FONT
and TINY_FONT
.
showMessage(text, font)
Display the text
on the device. One letter at a time.
Example
See in example folder.
Thanks
Thanks to rm-hull python project.