-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
I am running Johnny-Five on a Raspberry Pi connected to two Arduino Mega 3's using the Firmata.
LEDs, Buttons, Potentiometers and switches all work fine following the instructions here:
https://johnny-five.io/examples/board-multi/
However, HT16K33 Led.Digits do not. I can set up multiple boards, but only the first Led.Digits instance that I add will work, the others remain blank/off.
I am following the instructions here:
https://johnny-five.io/examples/led-digits-clock-HT16K33/
and then adding the board option, and I can use EITHER board, but if I try to add both, only the first one added works.
Here is the code I am using to test:
const { Boards, Led } = require("johnny-five");
const displays = [
{
id: "one",
port: "/dev/ttyACM3",
repl: false,
},
{
id: "two",
port: "/dev/ttyACM0",
repl: false,
},
];
const boards = new Boards(displays);
boards.on("ready", () => {
// This is only here to demonstrate that both boards work
const boardOneLED = new Led({ board: boards.byId("one"), pin: 13 });
boardOneLED.blink(500);
// This is only here to demonstrate that both boards work
const boardTwoLED = new Led({ board: boards.byId("two"), pin: 13 });
boardTwoLED.blink(500);
// Only the first one will work, the second one added will not.
// Reverse their order to demonstrate.
const boardOneDigits = new Led.Digits({
controller: "HT16K33",
board: boards.byId("one"),
});
const boardTwoDigits = new Led.Digits({
controller: "HT16K33",
board: boards.byId("two"),
});
boardOneDigits.on();
boardOneDigits.print("1111");
boardTwoDigits.on();
boardTwoDigits.print("2222");
process.on("SIGINT", () => {
console.log("Turning off displays.");
boardOneDigits.off();
boardTwoDigits.off();
});
});
Metadata
Metadata
Assignees
Labels
No labels