A module for generating animations on a Raspberry PI. Before you install this, please read this https://github.com/hzeller/rpi-rgb-led-matrix.
An example of using this module is available here https://github.com/meg768/hzeller-matrix-example.
$ npm install hzeller-matrix --save
Before you install, make sure you have GraphicsMagick installed on the Pi, and some other stuff.
$ sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get install libwebp-dev
$ sudo aptitude update && sudo aptitude install libgraphicsmagick++1-dev
var Matrix = require('hzeller-matrix');
var matrix = new Matrix({width:32, height:32});
matrix.runText('Hello World');
This has been working fine on a Raspberry Pi 2. But I have not been able to get a stable image/animation using a Raspberry Pi 3. It might be my long cables. Just a heads up.
Constructs a new matrix object. The config argument must contain the following values.
If config is not specified all methods will only log to console and no hardware is accessed.
Example
var Matrix = require('hzeller-matrix');
var matrix = new Matrix({width:32, height:32})
...
This method displays scrolling text. The callback argument is called when the animation completes. The options argument may have the following values.
Example
matrix.runText('Hello World', {textColor: 'blue', fontSize:30});
Display an image. The image parameter may be a string representing the file name or a JavaScript Buffer object. The callback argument is called when the animation completes. The options argument may have the following values.
Runs an animated GIF, frame by frame. The callback argument is called when the animation completes. The options argument may have the following values.
Displays a Matrix-like rain animation. The options are as follows. The callback argument is called when the animation completes. The options argument may have the following values.
Runs a perlin animation. The callback argument is called when the animation completes. The options argument may have the following values.
Displays a clock with the specified look. See https://github.com/meg768/hzeller-matrix-example for examples of clock images.
The callback argument is called when the animation completes. The options argument may have the following values.
Returns true/false if an animation is running or not.
Returns the matrix width.
Returns the matrix height.
Check out https://github.com/meg768/hzeller-matrix-example for more information.
Instructions how to se up and compile hzeller-matrix as of 2016-07-27.
Install image 2016-05-27-raspbian-jessie-lite.img. For the Mac, use Pi Filler.
For the Mac, use Lan Scan or Lan Scan Pro. Google it.
Start a Terminal session and use ssh to connect. When prompted, the password is raspberry.
$ ssh pi@10.0.1.73
Once connected, start raspi-config and select Expand File System. You may want to change the time zone as well.
$ sudo raspi-config
$ sudo reboot
$ sudo apt-get update && sudo apt-get dist-upgrade
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
$ sudo apt-get install -y nodejs
$ sudo aptitude update && sudo aptitude install libgraphicsmagick++1-dev
$ sudo apt-get install git libwebp-dev
$ git clone https://github.com/meg768/hzeller-matrix.git
$ cd hzeller-matrix
$ npm install
Edit the configuration file.
$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
And add this at the end.
network={
ssid="my-network-name"
psk="my-password"
}
Save and reboot. Connect again using the same ip-address as before and find out the wlan ip-address by running the following.
$ ifconfig
Now you can disconnect the network cable and log on to this new ip-address in the future.