easybotics / node-rpi-rgb-led-matrix

Pilot your rgb led matrix with Nodejs ! Nodejs binding of rpi-rgb-led-matrix library https://github.com/hzeller/rpi-rgb-led-matrix - Actively Maintained!
Do What The F*ck You Want To Public License
57 stars 17 forks source link

Update readme with more example #2

Closed ArcaneDiver closed 5 years ago

ArcaneDiver commented 5 years ago

Pls may you add example for scroll some text or display and image? I'm not really skillful the a help will be more appreciated. Thanks.

keptan commented 5 years ago

So if you're really having trouble you could use our node-red library here: https://github.com/easybotics/node-red-contrib-easybotics-led-matrix

for your specific example it probably looks something like this

var Matrix = require("easybotics-rgb-led-matrix");
led = new Matrix(32, 64, 1, 1, 100, "regular"); //this might be different for you

const input = "hello world!"; //whever you get the input from
const font  =  __dirname + '/fonts/' + "5x8.bdf";

//should be a function that calculates the postition based on timestamp
//and increments the x position
var x = 0;
var y = 0;

led.drawText(x, y, 255, 255, 255, input, font);
led.update();
while(true){};