Skip to main content

Questions tagged [button]

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

Filter by
Sorted by
Tagged with
16 votes
2 answers
9k views

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,565
14 votes
1 answer
975 views

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
7k views

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 ...
Brian G.'s user avatar
  • 273
9 votes
2 answers
816 views

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,430
8 votes
7 answers
19k views

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
  • 181
8 votes
2 answers
2k views

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,698
7 votes
5 answers
5k views

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
4 answers
1k views

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,430
6 votes
3 answers
9k views

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
10k views

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

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

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
3 answers
22k views

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
2 answers
17k views

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
1 answer
2k views

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
  • 367
4 votes
3 answers
42k views

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

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
942 views

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 ...
Gutenberg's user avatar
  • 143
4 votes
3 answers
5k views

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
762 views

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
199 views

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
267 views

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
4 answers
14k views

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 = digitalRead(...
wizofwor's user avatar
  • 298
3 votes
1 answer
14k views

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
3 votes
1 answer
544 views

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
270 views

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

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
929 views

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
5k views

I am just beginning my journey into the Arduino world - plenty of development experience, but basically nothing with electronics outside of building computers. The question I have involves wiring ...
Scott Salyer's user avatar
3 votes
1 answer
374 views

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

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
226 views

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
67k views

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

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
2 answers
1k views

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
3 answers
192 views

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
1k views

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
2 answers
313 views

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,435
2 votes
2 answers
853 views

Expected Behavior: I am attempting to use && or nested if statements to achieve the effect of two switches being required to close prior to an LED light (i.e., flip both switches), the LED ...
jmarywien's user avatar
2 votes
1 answer
1k views

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
110 views

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
409 views

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
139 views

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
2 answers
781 views

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
153 views

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
184 views

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

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

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

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
522 views

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

1
2 3 4 5
7