Control a 4 digit led segments TM1637 driver using javascript and johnny-five.
Largely inspired from raspberrypi-tm1637-4display and timwaizenegger/raspberrypi-examples.
Tested with a 4 digits, 4 decimal points tm1637 display from catalex.
npm i tm1637
const five = require('johnny-five');
const Raspi = require('raspi-io');
const tm1637 = require('tm1637');
const board = new five.Board({
io: new Raspi()
});
board.on("ready", () => {
const display = tm1637({
clk: "GPIO21",
dio: "GPIO20",
board: board
})
display.show("3.142");
board.repl.inject({
display
});
});
- Pins are johnny-five compatible pins
board
is a johnny-five board or any object which supportpinMode
,digitalRead
,digitalWrite
methods;