Questions tagged [button]

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

Filter by
Sorted by
Tagged with
15 votes
2 answers
8k views

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() { ...
sachleen's user avatar
  • 7,505
14 votes
1 answer
964 views

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 ...
Zero point's user avatar
11 votes
4 answers
6k views

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 ...
Sergey Snegirev's user avatar
9 votes
2 answers
707 views

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 ...
Cybergibbons's user avatar
  • 5,340
8 votes
2 answers
2k views

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 ...
Cerin's user avatar
  • 1,608
7 votes
5 answers
4k views

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 ...
Julius's user avatar
  • 91
7 votes
7 answers
18k views

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's user avatar
  • 171
7 votes
4 answers
1k views

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 ...
Cybergibbons's user avatar
  • 5,340
6 votes
3 answers
8k views

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 ...
Kokodoko's user avatar
  • 161
6 votes
5 answers
9k views

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.
Christopher Muhlbauer's user avatar
5 votes
3 answers
3k views

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 ...
Peter Bloomfield's user avatar
5 votes
3 answers
2k views

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 ...
AndreFro's user avatar
5 votes
2 answers
16k views

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 ...
Toni startup's user avatar
5 votes
3 answers
18k views

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 ...
Toma's user avatar
  • 157
5 votes
1 answer
2k views

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 ...
Rip Leeb's user avatar
  • 377
4 votes
3 answers
38k views

Detecting if a push button was pressed and released

I want to detect if a push button was pressed and released again. So I thought the right approach would be to first wait while the pin yields LOW and then wait while the pin yields HIGH: void push(...
Patrick Bucher's user avatar
4 votes
5 answers
15k views

Stop Led's from blinking

My code: // Pin 13 has a LED connected on most Arduino boards. // give it a name: int led = 13; const int buttonPin = 2; // the setup routine runs once when you press reset: void setup() { // ...
Utsav's user avatar
  • 231
4 votes
2 answers
836 views

Interrupts: use of the "volatile" keyword with a structure pointer for button debounce

I've written a small sketch targeted at the Arduino Uno (ATmega328P) to debounce a mechanical pushbutton using the summing/integration technique: #include <IntegratingDebounce.h> #define ...
w_hile's user avatar
  • 143
4 votes
3 answers
4k views

Multiple Buttons on Single Analog Pin and Trigger Pin Arduino Uno

I've researched how to attach multiple buttons to a single analog input using a resistor network. Instructables has a good lesson on this: http://www.instructables.com/id/How-to-access-5-buttons-...
hagope's user avatar
  • 161
4 votes
1 answer
643 views

Controlling relays with IR and button

What I have: 1 x 8 channel relay 1 x IR receiver 1x Arduino Uno 1x momentary switch 1x breadboard 1x 10K resister I think the wiring is all ok as for the most part things are working as they should.....
Michael Sinclair's user avatar
3 votes
2 answers
169 views

How to make an arduino button to forget his past purpose?

For my school project im making an arduino speedometer for a bicycle. I will be using a reed switch sensor to get the speed. There will also be an clock and a termometer, it will be on a 16x2 lcd ...
Marin Filipovic's user avatar
3 votes
1 answer
244 views

Powering potientiometer/button with a digital pin

When I read articles/tutorials about the Arduino Uno, the potentiometer and button always get power from the 5 V pin instead of from digital pins. May I know whether the two components above can ...
Chong Onn Keat's user avatar
3 votes
1 answer
484 views

Code test the duration press of the button

I wrote code that tracks the duration of a button click. It has bounce protection and frequent clicks. (Freeze) My code: bool freeze_time, btn_read, debounce; unsigned int freeze_timer, btn_timer; #...
Delta's user avatar
  • 263
3 votes
1 answer
144 views

Simulating a button press using the Serial Monitor to run a Servo

I'm kind of new to Arduino and C, and I was having trouble with this sketch. I'm working on a project to control 6 servos using virtual buttons. When I hold down the button, the servo moves forward ...
rayank97's user avatar
3 votes
3 answers
4k views

Breaking a switch case from an ISR

I'm struggling with something. My CPU sits in a switch case state machine like this: switch(expression) { case constant-expression_1 : statement(s); break; /* optional */ case ...
makepeace's user avatar
3 votes
1 answer
842 views

sending ctrl-z in a struct?

I have a set of buttons wired to an arduino leonardo that are meant to send either single keystrokes to a computer "a, b, c..." etc, or a key sequence like ctrl+z (to perform an undo command.) ...
sylcat's user avatar
  • 65
3 votes
1 answer
310 views

Increase or decrease const byte value inside the code with a push button

I'm kind of new in the Arduino world. I decided to make a self learning project with an Arduino where it controls a conveyor that simply moves from right to left and back again. There is a start and ...
Carlos Costa's user avatar
3 votes
3 answers
2k views

Button and switch to turn on and off LED and changing after time

I have system connected to an Arduino Uno where I want to read whether the switch is open or closed. Based on if the switch is open/closed, I want an LED light to turn on/off. When the switch is ...
kumquat's user avatar
  • 61
3 votes
1 answer
204 views

Button to optocoupler to fire camera 4 times

Ok, this is my first project where I've not had @forsvunnet close by to help. I've got a camera connected to an optocoupler, that just fires HIGH then LOW. I can't get a button working with it, so ...
Andrew Lazarus's user avatar
2 votes
10 answers
66k views

How to toggle LED on button press?

I want to have a LED turn on when I push a button and go off when I push the button a second time. This code doesn't work: const int buttonPin = 4; const int motorPin = 10; const int ledPin = ...
Coderboy's user avatar
2 votes
4 answers
1k views

Why doesn't this debounce function work?

Edit 2 I made a function that works, but I'm still confused about just one thing... I'm very confused about how variables work in C++. In this program... boolean debounce(void) { static ...
Dallin's user avatar
  • 23
2 votes
3 answers
127 views

Send button only works when pressed immediately after

I am new to Arduino and I am trying to create a Morse code based "chat". I can submit a message in Morse code using the send button (the one on the right,) and when I press the button on the ...
MarryPoppins's user avatar
2 votes
2 answers
812 views

How do I make LEDs lights up one by one according to how long the button was pressed and hold

In my project, I am trying to create a timer display with LEDs base on how long a button was pressed and hold. There are 8 LED lights in total, when the toggle button was pressed, 1st LED lights up; ...
Kelvin Ng's user avatar
2 votes
4 answers
13k views

My button control working in reverse

I built this circuit to learn button control. But my code (or button) is working in reverse. I want to initialize led flash effect when the button is pressed with this code buttonState = ...
wizofwor's user avatar
  • 288
2 votes
1 answer
458 views

Push button issues

I have been using https://wokwi.com/ to learn Arduino and I am having a problem that seems to be happening no matter what I do. I am trying to set up a push button and an LED. The end goal here is to ...
wgm's user avatar
  • 21
2 votes
2 answers
176 views

Tone() generates a high pitched sound when button is released

I have a simple circuit that makes use of the tone() function to produce some sounds. I also have a button, hooked with an interrupt function, that whenever is pressed, a variable changes. Sometimes, ...
user1584421's user avatar
  • 1,395
2 votes
1 answer
1k views

Arduino Timer with increase time button

I have an Arduino project to do, which requires a countdown timer(which I've already done). I connected a push button, and when I press that button I need it to increase my countdown timer by +10 ...
Radu Lucian's user avatar
2 votes
3 answers
92 views

80 Apple Homebuttons and a steppermotor [closed]

I am graduating in a month and I want to make an installation with 80 apple homebuttons which are connected to a stepper motor. The idea is that each button that is pressed, turns the stepper motor ...
Missy Skae's user avatar
2 votes
2 answers
361 views

Arduino with multiple buttons - will power be an issue?

I have a spare Arduino Uno lying around, which I figured I could attempt to turn into a game controller. First clear issue, that immediately popped up, was that there are not enough digital input pins ...
yakcyll's user avatar
  • 23
2 votes
1 answer
128 views

1x4 Button membrane help

Im trying out this membrane from Adafruit that i bought last week but i have a little issue. ITS SO SENSITIVE! i as so just touch it with my finger and it transmits!. Anyone that has worked with this ...
xR34P3Rx's user avatar
  • 123
2 votes
1 answer
10k views

Newbie Question with 4 pin button

I suspect this is a very Naive question. But the answer will teach me a lot. Why does this circuit work when I connect the Digital Input (Digial Pin 2) to Pin 4 of the push button. But does not when ...
Ray Kinsella's user avatar
2 votes
2 answers
711 views

Simply Button Problem (Teensy 2.0)

I am getting back into doing some hardware stuff after a fairly long time away and am having a hard time getting back into it. I have a Teensy 2.0 and am trying to run a basic sketch that when a ...
WhoaItsAFactorial's user avatar
2 votes
1 answer
111 views

Adding a common activation pin to a group of buttons

I'm working on an Uno, which has only two interrupt capable pins, but i need at least three buttons to wake it up from its power saving mode. Is there a way to wire buttons such that, in addition to ...
none none's user avatar
  • 233
2 votes
1 answer
147 views

Button to stop a stopwatch not working correctly!

I'm trying to implement a stopwatch with an LCD display, and I'm supposed to be using the attachInterrupt command to catch the button press. The clock runs perfectly, but the button input isn't caught ...
Raighley's user avatar
2 votes
2 answers
2k views

How can I use a transistor to "press" a button?

I have a heater remote that I want to press the buttons of with my Arduino. I am powering both the remote and Arduino from an external 5V source so both grounds are connected. Currently I have tried ...
Username's user avatar
2 votes
1 answer
11k views

Button with switch timer and reset time function + LED feedback. What am I doing wrong?

Beginner here. I´ve been trying to implement a button function timer working with millis() instead of delay as I want the button to be responsive while the timer is running. So far I´ve managed to ...
ifthisthenthat's user avatar
2 votes
2 answers
5k views

Multiple buttons on single interrupt, how to debounce?

Buttons on separate interrupt pins work fine (triggered on FALLING), bouncing is handling by forcing a 80ms lockout period during which further presses are ignored. I like that solution for being ...
kaay's user avatar
  • 223
2 votes
1 answer
200 views

ESP8266 seems to be killing a while loop

When i was testing out a program I found a strange behavior of esp8266 It seems to get out of a while loop even when there's no option of getting out on code I don't know if these are related but here'...
tatu101's user avatar
  • 73
2 votes
2 answers
90 views

Rasberry Pi Controlling Arduino - Reads "Ghost" Input - Doesn't Complete Logic Loop

I am using an Arduino Atmega2560 clone, I have used it many times before with satisfactory results - although I haven't used it with my Rpi before. My Raspberry Pi is model 4 (B I think?). #define ...
GeorgeWTrump's user avatar
2 votes
2 answers
162 views

Can anyone help be get readings off of my potentiometer with a push of a button?

Hi I'm trying to get my Arduino Uno code to work with a in a specific way where if I push a button, the Arduino will read the raw potentiometer value once and if I don't push it nothing happens. https:...
Matt's user avatar
  • 31

1
2 3 4 5
7