Questions tagged [button]

A button is a simple input component which responds to being pushed by a user.

The purpose of a button is to change the state of a connection when it is pushed. The connection change may be momentary (push-to-make or push-to-break), or it may be toggled on/off by consecutive pushes.

A microcontroller can monitor the connection, allowing the button to act as a simple input mechanism.

Use this tag when asking about using button components in Arduino projects. This can include issues such as connections and de-bouncing.

344 questions
16
votes
2 answers

Button state changing randomly

I have a push button wired to my Arduino but it seems to be triggering randomly. I have one pin of the button connected to pin 2 on the arduino and the other connected to ground. void setup() { Serial.begin(9600); pinMode(2, INPUT); } void…
sachleen
  • 7,565
  • 5
  • 40
  • 57
14
votes
1 answer

How to avoid that my arduino clicks eternally?

I have accidentally implemented a program that imitates the click of the mouse. The problem is that now I can´t delete the program because each time that I connect the USB, the computer starts clicking everything and it is not possible to upload a…
Zero point
  • 153
  • 4
11
votes
4 answers

Choosing wireless tech for lowest possible lag

I am drafting a pub quiz project, where the Referee gives a signal and multiple players push their buttons. The first to push wins the right to give an answer. I want all buttons (referee's + X players) to be wireless. Since the best quiz players…
Brian G.
  • 273
  • 3
  • 10
9
votes
2 answers

How frequently do you need to poll UI buttons before they are perceived as laggy?

Whilst it is possible, and sometimes desirable, to use pin change interrupts to read the state of buttons, it is simpler to poll the state of buttons in loop(). This is a commonly used technique. If you loop() executes quickly enough, then button…
Cybergibbons
  • 5,420
  • 7
  • 34
  • 51
8
votes
7 answers

Good button debouncing/stateChange library

I need debouncing/stateChange for a push button configuration. Is there a good library for debouncing/stateChange buttons in Arduino (without delay)?
Ariyan
  • 181
  • 1
  • 1
  • 6
8
votes
2 answers

Performance of internal vs external resistors

Is there any significant performance trade-off between buttons wired with the internal vs external pull-up/down resistors? I see a lot of tutorials demonstrating the use of external resistors when wiring a simple button, like this and this. But…
Cerin
  • 1,688
  • 2
  • 28
  • 45
7
votes
5 answers

What is the best technique to design a 20 push button circuit

I will be controlling a robot with more than 10 motors which means I'll need 2 buttons each to control moving forward and backward. My controller is an Arduino mega. Is 1 pin = 1 button the best solution here? Or should I use another IC for this?
Julius
  • 91
  • 1
  • 6
7
votes
4 answers

What design patterns can I use to handle user input and display updating?

I've used enough products with embedded microcontrollers and unresponsive UIs to know that it can make or break a product. Even a slight delay or lag between the button presses and the display updating, or button presses being ignored or double…
Cybergibbons
  • 5,420
  • 7
  • 34
  • 51
6
votes
3 answers

Why does this button have a connection to ground?

I am testing this basic button example from the Arduino tutorial page. This circuit lets power flow to pin 2 when the button is pressed. When the button is not pressed, the power goes through the resistor to ground, but my question is: why would…
Kokodoko
  • 161
  • 1
  • 6
6
votes
5 answers

How do I repurpose Arduino's reset button

Is there a way to repurpose the reset button for the code, like an on-board button? I don't need it to reset, but it would be useful to make it run through a list of RGB LED cycles.
5
votes
3 answers

How do I make another action repeat inside a loop?

So, I've just started programming Arduino (and also in general), so I'm doing basic things, like switching on and off LED's. I've made them light in a sequence and then turning them off (in the same sequence), and now I wanted to use 2 buttons, one…
AndreFro
  • 53
  • 6
5
votes
3 answers

Debouncing a button with interrupt

I tried to follow the answer here: https://arduino.stackexchange.com/a/18545/51302 Unfortunately I can only get the interrupt to go once (on serial monitor is the time of that first interrupt), then nothing. I know this has already been answered but…
Toma
  • 157
  • 1
  • 1
  • 7
5
votes
3 answers

Why does my sketch report too many button presses?

I've been using a button to interact with a sketch (on my Uno), and it's mostly working fine. However, sometimes it seems to be detecting multiple presses when it's only pressed once. It's a small circuit-mounted momentary button, which is normally…
Peter Bloomfield
  • 10,982
  • 9
  • 48
  • 87
5
votes
2 answers

Voltage changes but digitalRead always HIGH

I developed a simple push button project I used a wemos D1 mini I connected D3 pin to a pull down 1K resistor. I used a multimeter to measure D3 pin voltage. When I push the button, D3 pin voltage changes from 0.x volt to 4.x volt. But digital…
Toni startup
  • 61
  • 1
  • 1
  • 3
5
votes
1 answer

Reading button presses with the 74HC4067E multiplexer

My project is progressing quite well, but I am having some issues reading button presses through my MUX. The Goal Cycle through twelve buttons and twelve LEDs. When a button is pressed, light up the corresponding LED. I have one MUX for the LEDs…
Rip Leeb
  • 367
  • 1
  • 10
1
2 3
22 23