Questions tagged [button]

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

Filter by
Sorted by
Tagged with
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 ...
2
votes
2answers
281 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; ...
0
votes
0answers
39 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
2answers
51 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
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
175 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
42 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
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
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
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
42 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
0answers
53 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
57 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
61 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
102 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
225 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
98 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
47 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 ( ...
0
votes
2answers
94 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 ...
-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
52 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
2answers
239 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
1answer
177 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
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 ...
-1
votes
1answer
41 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
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
vote
2answers
98 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" ...
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
0answers
81 views

How to merge temperature sensor DHT22, RTC DS3231 and button [duplicate]

I am currently working on the fan function, which would be able to switch every minute for 10 seconds with RTC DS3231, at the same time I would like to incorporate a temperature sensor DHT22 and ...
0
votes
2answers
781 views

How Can I convert my arduino code to C/C++ embedded code [closed]

For example I have an code for arduino but I want to change it to embedded C to create more professional project with different hardware. is there any tutorial? I know the logic and the most of the ...
-1
votes
1answer
156 views

4:1: error: expected initializer before 'void' [closed]

int button void setup() { pinMode(13, OUTPUT); pinMode(12, OUTPUT); button 4; pinMode(4=INPUT); } void loop() { if(digitalRead(4)== LOW); { digitalWrite (13, HIGH); delay (250); ...
0
votes
1answer
100 views

How to connect Big Dome Button with arduino

I am quite new to arduino and for a project I want to use big dome button which when pressed it will count how many times has been pressed.It is using 12 volts.The button is this https://www.sparkfun....
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
36 views

I am trying to combine a button's coding and servo's coding. But it is still cannot be verified. What have I done wrong? [duplicate]

include Servo myservo; void setup(){ myservo.attach(8); pinMode(buttonPin, INPUT); } void loop() { myservo.write(0); delay(3); myservo.write(90); delay(3); } const int inPin=8; ...
0
votes
4answers
568 views

Detecting how many button presses(single tap, double tap etc) with two simultaneous buttons

noob here So what I am trying to do is output a different number depending on the number of button presses e.g. for 1 button press it should output 1 and so forth. After that I only really want the ...
0
votes
1answer
328 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
1answer
137 views

Menus not changing when button is pressed TFT 128 x 128

I've just followed a tutorial so that when a button is pressed it goes through a menu. Click once, next slide. Only issue is it isn't appearing on my screen at all. It has uploaded but I'm a total ...
0
votes
2answers
34 views

Push Button to Drive Power to Servo

I am currently doing a project for a class which uses a few other components such as an LCD, a servo, and such. I want to use a button which acts as a circuit breaker on the Vin of the servo in which ...
0
votes
1answer
62 views

How to add indicator lights to button sketch

I would like to add leds to each button switch in the first code, The first code sends midi messages to a DAW I would like it to also turn on a led as an indicator light. The switch needs to turn the ...
0
votes
0answers
35 views

Frequency Doesn't increase when Button Is Pressed

I’m trying to output a frequency that can be increased and decreased by using 2 buttons. I’m trying to first of all configure the first button (which increases the frequency). I’m trying to also add ...
0
votes
1answer
22 views

Wiring power new power button to UPS power module for raspberry pi [closed]

I have a UPS Power Module Expansion Board for Raspberry Pi 3B/3B+(Plus) and removed the power button because it is in the way and would like to attach this read button instead. But it is not working, ...
0
votes
1answer
177 views

2 buttons pressed at the same time elevator logic

I have currently created a working elevator code where the elevator goes up when pressed a button, and stops at a floor when the sensor senses that it has reached the floor. This is how it works: #...
2
votes
1answer
217 views

Run light sequence function continuously in if statement

My goal - run light sequence function on momentary button press (button 2) continuously until another of the 3 momentary buttons are pressed. /* switch * * Each time the input pin goes ...
0
votes
2answers
190 views

control 3 relays with 1 button

Is there a way to control 3 relays with 1 button? My idea is: There are 3 modes; mode 1 for relay 1, mode 2 for relay 2 and mode 3 for relay 3. With a long press you switch between modes (After 3 ...
0
votes
2answers
560 views

how to interrupt the loop function and restart it?

I have a project with some NeoPixels and other LEDs and an Arduino UNO. Once switched on, the defaultLEDAnimation with colors and blinking, etc. starts. I want to trigger some other animations, so 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
2 3 4 5 6