-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use Led.Digits with Multple Boards #1834
Comments
This is interesting. Here's what I think is happening... The HT16K33 is an addressable I2C device. Both of yours start at 0x70, which I believe is the default value. If no address or array of addresses passed, a built-in list of available addresses is used. That list is not built with consideration of multi-board environments, so 0x70 gets shifted off for the first one instantiated and J5 thinks the second one is at the next available address. I think if you explicitly pass the address or addresses, it will not use the built-in list. const boardOneDigits = new Led.Digits({
controller: "HT16K33",
board: boards.byId("one"),
address: 0x70
});
const boardTwoDigits = new Led.Digits({
controller: "HT16K33",
board: boards.byId("two"),
address: 0x70
}); |
Thanks, that makes sense, but when I try it I get this error:
It looks like the code has a list of valid addresses, and removes those addresses as they are used here: So trying to use the same address twice fails. I tried passing in a new list of addresses with each call
but the result is the same. Oh wait, is this a bug or a feature?
It iterates over Not sure if that is a bug or a feature, but it seems like I can never use 0x70 (112) twice in the code ever. I'm not sure what the intended behavior is here. Should line 458 check Oh and now I see Do you see any other way round this without editing I'm going to experiment with editing |
You could change the address on one of the HT16K33's to 0x71. I imagine it just takes a little bit of solder. |
Haha, so I could, but for a number of reasons I need this to work without further modifying the hardware on the various installations. |
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 firstLed.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:
The text was updated successfully, but these errors were encountered: