Looking for buttons pad which with Vcc-GND.

Thread Starter

LAOADAM

Joined Nov 21, 2018
879
Hi evryone.
I found the button pad as below:
button.JPG
they are good design, tiny and easy to use.
but they have only GND + Ki pin, they don't have Vcc.
its not as good as the wiring below:
Multiple-Push-Buttons-On-Multiple-Arduino-Digital-Inputs.jpg

where can find this kind of please? or soldering it?
Thanks
Adam
 

Ya’akov

Joined Jan 27, 2019
9,165
That switch array is designed to pull the pins LOW. You can use it as it is if you just change the code to make the switched active low instead of high. It just means you need to check for 0 instead of 1, or false instead of true. You should also make sure you configure the pins with pullups.

The code should be the opposite of what it is now, that is, something:

Active Low Buttons:
pinMode(3, INPUT_PULLUP);                   // configure pin 3 as input with internal pull-up

if (!digitalRead(3)){                       // the ! in front of the read means "not", it will evaluate TRUE if the pin is LOW
  // do whatever you want when the button on 3 is pressed
}
 
Top