Use to support the adafruit led backpacks - ht16k33
npm install backpack-ht16k33If you run into any issues please create a ticket.
sh
npm install backpack-ht16k33
`$3
`js
var tessel = require("tessel");
var backpack = require('backpack-ht16k33').use(tessel.port['A']);backpack.on('ready', function() {
backpack.clear();
var bitmap = [
[0,0,1,1,1,1,0,0],
[0,1,0,0,0,0,1,0],
[1,0,1,0,0,1,0,1],
[1,0,0,0,0,0,0,1],
[1,0,1,0,0,1,0,1],
[1,0,0,1,1,0,0,1],
[0,1,0,0,0,0,1,0],
[0,0,1,1,1,1,0,0],
];
backpack.writeBitmap(bitmap);
});
`$3
# backpack.clear ( callback(err) ) turns off every light on the led # backpack.writeBitmap ( bitmap, callback(err) ) the bitmap is and array of bits. Each 1 will be turned on and the 0 will be turned off.
# backpack.animate ( frames, interval ) renders each frame in order with a separation in ms equal to the interval
# backpack.scroll ( bitmap, interval ) scrolls the bitmap horizontally with a separation between frames in ms equal to the interval. Bitmap can be any width
# backpack.scrollText ( text, interval ) scrolls the text horizontally with a separation between frames in ms equal to the interval. Text can be any lenght
$3
# backpack.on( 'error', callback(err) ) Emitted upon error. # backpack.on( 'ready', callback() ) Emitted upon first successful communication between the Tessel and the module.
$3
`js
var tessel = require("tessel");
var backpack = require('../').use(tessel.port['A']);backpack.on('ready', function() {
backpack.clear();
var smile = [
[0,0,1,1,1,1,0,0],
[0,1,0,0,0,0,1,0],
[1,0,1,0,0,1,0,1],
[1,0,0,0,0,0,0,1],
[1,0,1,0,0,1,0,1],
[1,0,0,1,1,0,0,1],
[0,1,0,0,0,0,1,0],
[0,0,1,1,1,1,0,0],
];
var straight = [
[0,0,1,1,1,1,0,0],
[0,1,0,0,0,0,1,0],
[1,0,1,0,0,1,0,1],
[1,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,1],
[1,0,1,1,1,1,0,1],
[0,1,0,0,0,0,1,0],
[0,0,1,1,1,1,0,0],
];
var frown = [
[0,0,1,1,1,1,0,0],
[0,1,0,0,0,0,1,0],
[1,0,1,0,0,1,0,1],
[1,0,0,0,0,0,0,1],
[1,0,0,1,1,0,0,1],
[1,0,1,0,0,1,0,1],
[0,1,0,0,0,0,1,0],
[0,0,1,1,1,1,0,0],
];
var frames = [smile, straight, frown];
backpack.animate(frames, 500);
});
``