Hello, I wanted to use 2 buttons for my project, I connected rfid to 3.3V Servo to 5V and LCD to IOREF, now i want to connect 2 buttons to use them in code. How can I do it? (I have arduino uno and leonardo)
The most common way to connect a button is:
Arduino Pin ----> Button ------> Ground
Then In setup():
pinMode(ButtonPin, INPUT_PULLUP);
Will activate the builtin pullup resistor. This keeps the Pin at 5v when the button is not pushed.
Then the button will read LOW when pushed this is called "active low"
if (digitalRead(ButtonPin) == LOW)
{
// button is pushed
}
Hutkikz:
The most common way to connect a button is:Arduino Pin ----> Button ------> Ground
Then In setup():
pinMode(ButtonPin, INPUT_PULLUP);
Will activate the builtin pullup resistor. This keeps the Pin at 5v when the button is not pushed.
Then the button will read LOW when pushed this is called "active low"
if (digitalRead(ButtonPin) == LOW)
{
// button is pushed
}
Yeah, i actually thinked like that, but all ground are taken 1 by rfid one by lcd and one by servo, is there any other way/gnd pin?