Questions tagged [button]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
61 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 ...
1
vote
0answers
27 views

I need help creating a code that moves a DC motor CW or CCW based off of 2 different buttons

I know I can make the motor move backwards and forwards with buttons but I don't want it to move at full speed. I want it to increment in very small amounts to where it can be adjusted very small ...
3
votes
1answer
146 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 ...
2
votes
1answer
53 views

status whether the switch is connected to arduino or not?

I made a small circuit in which a push-button is connected to Arduino via a pulldown resistor. So, whenever it is pressed it connects to 5V otherwise pulled down to the ground. this is working fine ...
1
vote
1answer
54 views

Continuous push button detection in for Stepper control

Currently i've working code of controlling stepper motor with pushbuttons. So, basically i have to press two push button to run forward and backward. but the problem is , when i press 1st pushbutton ...
0
votes
1answer
41 views

RGB LED using potentiometer and push button

I'm currently working on an assignment which has to turn on an RGB LED using a potentiometer and button. The problem I currently have is that the button is supposed to change the color I want the LED ...
0
votes
1answer
64 views

connecting a push button to a step Motor Problem

I can't get this code to work. The button code and the step motor code works separately. However, when I code using an if statement saying when the button is pressed the motor will move or else it won'...
1
vote
1answer
37 views

Saving a value with a click

I have a rotary encoder and 2 buttons to a. Store the encoder value b. Reset the encoder value to 0. The reset buttons work fine the issue is with the set/store button. Where the value changes without ...
1
vote
2answers
105 views

Only print when the button is pressed and not being pressed anymore

I have an Arduino and a microswitch that I want to use to know when the switch is initially being pressed (get "OnsetTime" on Serial) and when the switch is not being pressed anymore (get "OffsetTime" ...
2
votes
2answers
283 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; ...
1
vote
3answers
2k views

Using a pushbutton to power Arduino on and off

I need help adding a pushbutton to provide power to an Arduino to save power, as I am using a battery and the same button to power it off. This is the circuit I wish to implement. Thanks.
0
votes
1answer
138 views

DS3231 + button to trigger light

please can someone help me with code, i want to have automatic trigger on specific hour, also i want to have button switch if needed, in my code i can press the button to trigger light relay, but my ...
0
votes
1answer
277 views

Button state issue

Let me preface this by saying I'm a beginner, and I know my code must have some logic errors. I need some fresh eyes on this, I have been messing with it a few days and am just running in circles at ...
0
votes
2answers
54 views

How do I make my LCD screen scroll text while allowing for button input?

Here's what I want my code to do: This is part of a tea infusing project that would automate the steeping of tea, part of this is initially having a selection of either Black/Herbal tea or White/Green ...
0
votes
1answer
55 views

Problems with detecting button digital state

I am trying to start an event after pressing and holding the FLASH built-in Nodemcu button for a specific time, I wrote two functions, one for debouncing and detecting the state, the other is to ...
0
votes
0answers
31 views

Button triggering when i get near [duplicate]

I set up a simple code to tell me if the button was pressed or not. When I get within a foot of the Arduino the button triggers. I first noticed this when trying to trigger a servo with a button. I've ...
1
vote
3answers
183 views

using a switch case with a 5-position switch and serial output

I'm trying to get started on developing a menu system for my LCD1602. I have a Parallax 5-position switch (up,down,left,right,center) and I would like to interface the two. I've been trying to get ...
0
votes
2answers
43 views

External Button Interrupt (Digital Pin 3) of Arduino not working

I am trying to execute external button interrupt with Arduino and 16*2 alphanumeric LCD. What I am trying to do is when I press the button then the screen should switch between different options. When ...
0
votes
0answers
41 views

problem controlling rgb led with one button

I'm trying to make a lamp which quality to change color by pressing a button, pressing once turns on red, pressing again turns on blue and so on, but I also want it to have a light effect in which it ...
0
votes
1answer
780 views

How to programme a button per colour for a neopixel strip?

I am trying to make a particular pixel in a neopixel strip, turn green, red or blue depending which button has been pressed and to stay on until pressed off again (like a toggle), but currently when I ...
2
votes
10answers
62k 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 = ...
0
votes
0answers
38 views

Button example: resistor vs wire

I am playing with this basic example: Arduino: Button There're a lot of existing questions about why to connect button to the ground. I get the idea more or less. Is done to avoid "noise" during ...
0
votes
1answer
45 views

Trying to move servo motor via 3 buttons

I am having some difficulties in trying to make my servo motor move to a specific angle based on the button pressed. For example, having the motor start at 0 degrees and then having it move to 180 ...
0
votes
1answer
368 views

Multiple buttons to control relays

Dears, I have a problem that I could not solve for a while, I tried the code below but it did not work. There will be 4 buttons controlling 4 relays but in a way that button one will turn relays 1&...
0
votes
2answers
17k views

Press the Windows key using “keyboard.press();”

Is it possible to allow an Arduino Leonardo to simulate pressing the Windows key using the keyboard.press(......); command? If so, what is the required value?
0
votes
0answers
57 views

Start / Stop Motor Run with Button State Change

I'm trying to understand Arduino with push buttons. But I can't get the test project I'm working on to work as how I want it to do. Basically what I'm trying to do with the codes below is to make ...
0
votes
1answer
60 views

I'm trying to control a servo with a push of a button but its not working HELP

I'm new to Arduino and I'm following this tutorial: https://www.youtube.com/watch?v=T2HMJiy9b_I but the problem is the servo just keeps moving back and forwards on it own and the button is doing ...
0
votes
1answer
24 views

Correct position for buttonState in my FSM

I wrote a FSM with the help of some tutorials through out the world wide web and so far it does what I want to do with it. But one thing that is not the way I want to be, is to exit the state ...
0
votes
2answers
67 views

Restart sequence of NeoPixel stick with a push button at any time

I am really happy with my new Arduino stuff and playing around with all those pixels :). I am new to programming and it's difficult to understand it, but with every success, I grow in knowledge. My ...
0
votes
1answer
41 views

read state from button to check if clicked

I"m kinda new here and new to the arduino framework. I want to build a "menu" using LCD 20*4, so I want to detect "button clicked" event. I've connected button to pin 8 and to ground, like this(...
3
votes
2answers
104 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 ...
0
votes
0answers
260 views

Break a while loop with a push button (AccelStepper.h)

Disclaimer: This is my first Arduino project. Background: I am building a "rapunzel tower" lantern for my daughter: the witch pays a visit to Rapunzel meanwhile my daughter can read a book (or still ...
-2
votes
1answer
132 views

Having issue with a redeclaration as a different kind of symbol

Been struggling with this for a few days and I suspect that i have several issues but I cannot find them. Project: Need a serial count that counts by 5-50 and a button interrupt should trigger a ...
-1
votes
1answer
49 views

How can I make my Arduino Esplora program start on the press of a button and then continue to run without me having to hold the button down? [closed]

I am trying to create a program where the main code starts on the press of a button. I am using an Arduino Esplora, and I want to have the built-in LED be blue when I plug in the power until I press ...
0
votes
2answers
37 views

Displaying when Button has been pressed for LED and returning 1

I've just started using Arduino and I'm having trouble getting my code right. Here is the task I need to do. "Create a button read function Hint: the function header should be int checkbutton ( ...
14
votes
1answer
7k 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() { ...
0
votes
2answers
99 views

Substitute multiple potentiometers for push buttons and single potentiometers

this is my first post here. For some time I have been struggling with a problem and would like to know if anyone has a solution to share. I am building a 4 tone sequencer, where I use 4 ...
0
votes
2answers
3k 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 ...
1
vote
1answer
284 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 ...
-3
votes
4answers
129 views

How should I connect 5 buttons to arduino so that I can use the least number of inputs all the buttons are connected to ground

The problem here is that I want to connect 5 input buttons to an Arduino but I do not want to utilize 5 input pins of Arduino, is there any matrix like connection using which I can reduce the number ...
0
votes
0answers
56 views

What is the best way to replace the buttons inside a car remote chip so that it can be controlled via Arduino?

I have a car remote that looks like the following I would like to replace the buttons with some sort of switch or relay that can be programmatically controlled via an arduino unit. Would a simple ...
0
votes
2answers
283 views

Press On Hold Off Power Switch

Hi everyone I am hoping someone here can help me. I am trying to make an arduino turn my project on and off.Using a relay. I am looking for it to act like a computer power button. A short press to ...
0
votes
2answers
53 views

NeoMatrix Button Troubles

I am creating a 20x15 LED Matrix using and Arduino Nano. My goal is to switch between different "scenes," if you will, using 4 buttons (I just need to run different code to make it display something ...
0
votes
1answer
208 views

How to detect button presses with a 74HC595 shift register?

Is there a way I can have my arduino uno differentiate between pushbuttons that are wired through a shift register and detect when each are pressed or not? I found this tutorial for the 74HC165 but I'...
-1
votes
1answer
89 views

Trying to light an LED with one Button and have no idea what is wrong

New to Arduino. I am trying to use a single button to light and turn off a single LED. I followed an online tutorial (youtube video) and changed the code just a bit. I know it is for two LEDs but I ...
1
vote
1answer
27 views

How to (optimally) fetch a button press? [duplicate]

For my hardware, I need to check if the button was pressed, but I need to do things only once every half a second. if (digitalRead(pin) == HIGH) { doStuff(); delay(500); } The above does ...
2
votes
1answer
8k 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 ...
-1
votes
1answer
47 views

light leds from an array

I have the project to build a robot for my school. It will record button pushes then move according to this record. Before usig motors, i'm trying to do this using leds. Thanks from posts from this ...
0
votes
2answers
71 views

Button circuit draws all power away from LEDs

I'm very new to Arduino, so please forgive me if I don't know the proper terms for things. Whenever I press the button on the board, the LEDs all shut off. I can't host the image files on imgur, and ...
0
votes
1answer
41 views

Servomotor AND Button

I am having trouble trying to make servomotor and button work together. The button code here below works fine when alone in a separate code but when it is transferred to the code with the servomotor ...

1
2 3 4 5 6