Skip to content

louiemontes/node-led

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-led

What is this repo?

This repo is a library compatible with Rick Waldron's johnny-five project. It adds support for Adafruit's LED backpacks.

Install

npm install node-led

8x8 matrix example

var five = require('johnny-five'),
    board = new five.Board(),
    Matrix8x8 = require('node-led').Matrix8x8;

board.on('ready', function() {
  console.log('Connected to Arduino, ready.');

  var opts = {
    address: 0x70
  };

  var matrix = new Matrix8x8(board, opts);

  var smile = [
    0b00111100,
    0b01000010,
    0b10100101,
    0b10000001,
    0b10100101,
    0b10011001,
    0b01000010,
    0b00111100
  ];

  matrix.drawBitmap(smile);

});

EightByEightMatrix

7 segment numeric example

var five = require('johnny-five'),
    board = new five.Board(),
    SevenSegment = require('node-led').SevenSegment;

board.on('ready', function() {
  console.log('Connected to Arduino, ready.');

  var opts = {
    address: 0x70
  };

  var display = new SevenSegment(board, opts);

  display.clearDisplay();
  display.writeText("3.A:C.E")
});

SevenSegment

14 segment alphanumeric example

var five = require('johnny-five'),
    board = new five.Board(),
    AlphaNum4 = require('node-led').AlphaNum4;

board.on('ready', function() {
  console.log('Connected to Arduino, ready.');

  var opts = {
    address: 0x70
  };

  var display = new AlphaNum4(board, opts);
  display.clearDisplay();
  display.writeText("Node");

});

AlphaNum4

TODO:

  • 16x8 matrix
  • 8x8 bicolor matrix
  • bicolor bargraph

About

Johnny-five support for Adafruit LED backpacks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published