Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • two ones on top is meaningless ... how are they connected? Commented Jan 19, 2022 at 1:45
  • have you checked if a matrix keypad library is available? Commented Jan 19, 2022 at 2:48
  • Did you "rotate" the rows, to see whether the port pins or the matrix give the issue? Did you try with a smaller number of rows, and increase it one by one? Why do you change the pin modes of the rows, they can always be INPUT_PULLUP? -- Unrelated: the condition in print_layout() does not prevent the printing of the last comma. col_Index is always lower than col_Count there. -- Unrelated: You can automate the calculation of the sizes, for example const int col_Count = sizeof cols / sizeof cols[0];. Commented Jan 19, 2022 at 7:01
  • @jsotola I made a dirty sketch, "two ones on top" refers to R1 and R2, and I'm not using the keypad library because I think it is unnecessary and apparently multiple key presses at the same time don't register. Commented Jan 19, 2022 at 15:27
  • @thebusybee I've tried switching around the row pins, there wasn't an issue with the "first two rows" in particular, the problem only began when I hooked up more than 2 rows to it, then only the "last two" would work. The idea with INPUT_PULLUP was to only check periodically whenever I wanted to, then switch to INPUT, I'm not sure if this makes sense because this is the first time I'm using this pinmode. Thanks for the other tips I've already implemented them. Commented Jan 19, 2022 at 15:32