0

enter image description here

Bear with me here, I'm new to arduinos, so what I'm saying might only make sense in my own mind.

I'm trying a button matrix and I not completely sure on my wiring and I have a few questions.

  1. Is the diagram correct?
  2. I wire D2 to D3 and set them to output and input respectively. In the code I digital write to D2 a HIGH, will D3 then read high?
  3. What is the best way to read the state of each button? Is there a Library that can simplify it?

I'm sorry if this is all just confused gibberish.

EDIT: I got the idea from this video, which explains some of it, but no code. He however uses an arduino micro.

EDIT #2: I realized I wired the buttons incorrectly.

  • Is this what you are looking for: playground.arduino.cc/Code/Keypad – Jot Aug 4 '18 at 20:26
  • you are using 4 wires to read 4 switches .... you could just use one pin for each switch ..... enable internal pullups on the pin and connect the switch between the pin and ground – jsotola Aug 4 '18 at 21:08
1

@Jot commented to use the Keypad Library. Which I got to work using the tutorial. Took a few minutes to set up.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.