I am working on a project and need alot of toggle buttons to control various things around the house. I connected 5 MuxShield 2's to my Arduino Mega. The first two will serve as inputs and the last two will serve as outputs. The problem is when I try to loop over all the outputs (connected to LED's for now) to turn them on/off, only the first 3 rows work as expected. The LED's turn on one by one, but when the loop reaches a row number which it has already looped over on another multiplexer the LED's turn on all at once.

I think it has something to do with the arrays in the MuxShield library being shared across all multiplexers and therefor breaking all signals the second time it gets used but I'm not sure. It's not that much code but, too much to post here so I uploaded it to GitHub.

If someone could please look over it and point me in the right direction, I'd greatly appreciate it. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.