Become a leader in the IoT community!
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
I’m looking to decode an existing switch matrix (4 Rows and 16 Columns, basically copy the states of the Rows and Columns).
The goal is to ultimately have a [data] where I will have:
ROW 1 == LOW && COL 1 == LOW, which will result in DATA == LOW.
In my case, only INPUTs are needed, the Arduino should not generate the matrix but only read it (so no OUTPUTs).
After obtaining this variable [DATA], I need to add a condition Supp [DATA] && x == 1 to store it in another variable in order to pass it into a SWITCH CASE.
Then, I can do things like: (but I have 64 switches)
if (ROW 1 == LOW && COL 1 == LOW) {
// for example, turn a LED to HIGH
}
else {
// if necessary
}
I haven’t found any code that allows me to solve this issue.
Use a nested loop instead of the switch.
The MatrixKeypad library does this very well. https://github.com/victorsvi/MatrixKeypad You can install it from the IDE’s library manager.
CONTRIBUTE TO THIS THREAD