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.

341 questions
15
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,525
  • 4
  • 39
  • 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
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
3
votes
1 answer

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 when I push a button, it fires opto 3 times. This is…
Andrew Lazarus
  • 243
  • 1
  • 2
  • 7
2
votes
1 answer

Hooking up 12v Push button to arduino uno/nano

I want to use one an push button with an led in middle, similar to this one on eBay. The push button has a 12v input I want to hook it up to an Aduino Uno or Nano. Is there a way to hook it up and receive the signal? Specifications from the eBay…
Peter Sun
  • 145
  • 2
  • 5
2
votes
1 answer

How can I know how far a button is pressed?

I want to make a system that can count coins. The problem that I know have is that I need a way to detect the size of the coin. The idea that I have is a beam that becomes smaller if you a inject a coin. The size of the beam depends than on the…
Erwin001
  • 23
  • 3
2
votes
2 answers

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 button is pressed will output 0, but my button is…
2
votes
10 answers

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 = 6; int x = 1; // variables will change: int…
Coderboy
  • 21
  • 1
  • 1
  • 2
2
votes
1 answer

How do I lock out a push button input with a selectable delay?

I have a program i am working on where a relay is turned on -> waits a delay -> then turns off after either one of two things happen: 1) A set timer is reached OR 2) someone pushes a push button to trigger it. Right now 90% of my code is working and…
2
votes
1 answer

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 membrane have the same issue? is there some sort…
xR34P3Rx
  • 123
  • 4
1
vote
0 answers

Why is my button not working?

I'm trying to making a traffic light for my school project but my button for the traffic light doesn't work. The traffic lights should light up normally but when the button is pressed all LEDs should go to LOW but that does not happen. Did I connect…
1
vote
2 answers

button connection without connection to 5V pin

There are two types of tutorials for buttons: I don't understand how a button on the first image works. Do we just hope that there is some non zero voltage and hope its enough? I think the first image is really bad, but can't explain why.
GrayR
  • 113
  • 4
1
vote
1 answer

Buttons, LOW vs no connection

I'm working with a very simple circuit to understand push buttons. The code in the tutorial uses the INPUT_PULLUP pinmode. I understand the idea of the pinmode, but I have two questions: There must be a difference between a LOW reading and no…
User26
  • 11
  • 1
1
vote
1 answer

Turn Arduino on only by double tapping switch?

I don't have much experience with electronics. I was wondering if it is possible to create a push button switch, which will turn on the device only if it is tapped twice in quick succession? If it is tapped only once, then the device should behave…
Kaizer Sozay
  • 129
  • 5
1
vote
1 answer

Button not working - Arduino Due project (MiniEngine v2)

I am building Arduino Due based project called MiniEngine v2 (an open-source motion control software for timelapse photography). The project is not very active anymore but there are still all the documentation at github. Project owner had webshop…
user1394520
  • 121
  • 2
1
2