1.0.2 • Published 6 years ago

ht16k33 v1.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

HT16K33

Description

Library for modules using I2C protocol with HT16K33 chip.

Test

Tested with Adafruits Quad Alphanumeric Display Digits I2C Backpack.

Availability

At this time only 14 segments module library is available.

Setup

npm i -S ht16k33
const Segments = require('ht16k33').Segments;
const display = new Segments(0x70, 1);

Examples

A clock

const Segments = require('ht16k33').Segments,
    display = new Segments(0x70, 1);

// display a simple clock
display.clock();

Digit roll

const Segments = require('ht16k33').Segments,
    display = new Segments(0x70, 1);

// default rolling chars are '-\|/'
// roll digits for 30s at 10fps
display.rollDigits(100, 30000, true);

Custom digit roll

const Segments = require('ht16k33').Segments,
    display = new Segments(0x70, 1);

// set rolling chars to 'rolling'
// check 'lib/14-segments-font.js' to list all available characters
display.setRollChars('rolling');
// roll digits for unlimited time at 2fps
display.rollDigits(500, null, true);

Countdown

const Segments = require('ht16k33').Segments,
    display = new Segments(0x70, 1);

// 1h countdown
display.countDown(3600);

Licence

MIT