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
382 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 ...
1
vote
1answer
44 views

Detect button press in a loop

I am designing simple "Simon Says game" using Arduino. Simon says is a game in which a LED pattern is played and user has to mimic the pattern. There are 10 Rounds. First Round = 1 led, ...
6
votes
3answers
785 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 ...
3
votes
1answer
109 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 ...
0
votes
3answers
51 views

Problem with DC motor

I've got a circuit with Arduino UNO Rev3, DC motor, button to switch direction of rotation and potentiometer to regulate revs. The problem is that usually when I increase voltage using potentiometer, ...
0
votes
1answer
482 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 ...
1
vote
2answers
55 views

Serial.print() Inferferes with my digitalRead()

I'm running into issue properly reading a button connected to a digital I/O pin on my Adafruit Feather HUZZAH ESP8266 device. I've implemented the debouncing script exactly as the Arduino provided ...
1
vote
1answer
59 views

Timing push button code

I am trying to time how long button is held for. The code seems to work but with two problems: the millis values are being read wrongly. If you hold the button for 1 second, it returns holdTime of ...
1
vote
0answers
33 views

DigitalWrite enabling external circuit only half ot the times

I'm a beginner making a simple arduino for a school project with an arduino uno. After the press of a button I activate, after a small delay, an external circuit obtained by disassembling another ...
0
votes
1answer
41 views

Doesn't stay in sub menu

So hello everyone. I'm creating simple menu with few sub menus,on my lcd screen. But i have run into small problem, i can't stay in my sub menu. When i press select button, it goes into submenu ...
0
votes
2answers
102 views

Pushbutton to initiate a 5 time flash

The following code operates in a way that LED starts to flash only if the pushbutton is pushed for one second. I want to change this and make the LED flash for 5 times, immediately on push, regardless ...
1
vote
0answers
60 views

Arduino button voltage versus HIGH/LOW state

I'm measuring voltage between button's ground and input pole on the following sketch. When button is on off state, there's 5V there, when it's switched on and led turs on, there's 0. Is this a correct ...
1
vote
1answer
95 views

Making pushbutton behave as a toggle switch with ezButton - do I have to use ledstate with =! operator

I'm using ezbutton to make a pushbutton act like a toggle switch, first press doing permanent on, second press doing permanent off. I'm just trying to understand the basic coding. This project is just ...
2
votes
3answers
82 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 ...
1
vote
1answer
34 views

How to connect an Output to a Pullup Input of another arduino

:tldr; Could problems occur if one connects a HIGH Output of one arduino to a PULLUP_INPUT of another while using differed power sources? Hi I'm building some devices for a LARP Dungeon (think Escape ...
1
vote
1answer
47 views

Arduino UNO With On / Off Module Switch + Battery Advice

So I have the following connected and the programming works fine when connect by USB The Parts 1 Arduino UNO 1 Laser Module (KEYS) 1 Rocker Switch Module (Standard 3 PIN) 2 Variation Motors (KEYS) 1 ...
1
vote
0answers
21 views

Building a line follower and keep getting errors just need help getting in the right direction to finish the code error located at the bottom [closed]

const int leftMotorPin = 9; const int leftSensorPin = A0; const int rightMotorPin = 8; const int rightSensorPin = A1; int rightlightThreshold = 100; int lightThreshold = 300; int buttonPin = 7; int ...
2
votes
3answers
59 views

How do I make my piezo buzzer only hum once without repetition?

I have a problem with getting my buzzer to only do the tones I programmed in once. I know I have to add some sort of code but I'm relatively new to this so I don't really know. I want it to start ...
1
vote
0answers
26 views

New to Arduino and looking for direction to research for a project idea [closed]

I'm fairy new to python, learning for about 5 months by myself, and found out later that arduino is coded in C/C##. Transferring general python knowledge to Arduino im sort of able to figure out how ...
1
vote
0answers
20 views

Let Servo rotate when file has been uploaded to webpage

I'm building an installation with a NODEMCU 1.0 where I want a servo motor (MG90S) to rotate when a file has been uploaded to a webpage. For my first step I have used this tutorial: Build an ESP8266 ...
1
vote
0answers
39 views

Enter a three digits number using push button connected to Arduino [closed]

I have the code given by my tutor and I need to change the code to be able enter a three digits number with the push button of switch module. Here is the code which can only enter one individual ...
0
votes
2answers
212 views

How can I add a potentiometer and more buttons to my custom game controller?

I'm new to using Arduino, and know next to nothing about programming. I'm currently trying to add a potentiometer, and possibly a few more button inputs to my 3D-printed guitar controller project It ...
1
vote
1answer
263 views

Continuous push button detection in for Stepper control

Currently, I've worked on code for controlling stepper motor with pushbuttons. So, basically, I have to press two push button to run forward and backwards. but the problem is when I press the 1st ...
1
vote
0answers
34 views

How to program the joystick button to reset everything?

In this project, I'm making a stickman rush game with a joystick. Where when the joystick moves up and down, the stickman also moves up and down. And there are obstacles, that when the stickman ...
0
votes
0answers
30 views

permanent shutdown of the alarm

#include <RTClib.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display int nowHr, ...
0
votes
1answer
48 views

force the state of the output

i have one input and buzzeer output and reset pushbutton if the input is high the buzzer will be on and i want to turn off the buzzer by the pushbutton even if the input still high any suggestions to ...
0
votes
0answers
63 views

I need to make button to turn off my alarm on clock

well I get task to make school project alarm clock using arduino, xd as you can see im not very good at it i mean i know something but not everything so please can someone help me, i copied this code ...
2
votes
0answers
51 views

Single LED controlled by two pushbuttons - one of which acts like a toggle switch

Trying to control this LED with those 2 pushbuttons - one button that starts a short flashing sequence, another pushbutton acts like a toggle switch, one press bulb is on, another press bulb is off. ...
1
vote
0answers
46 views

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 ...
0
votes
1answer
54 views

Arduino while loop with or condition

How do I write a program to wait (delay) until one out of two buttons pressed? I have written a program to wait until a single button is pressed. It's working fine. However, if I extend it to second ...
1
vote
1answer
71 views

Stepper motor won't change directions!

I am driving a bipolar stepper motor with an a4988 driver using the AccelStepper library. My goal is to press a button and the motor moves CW, then another button for CCW. I have looked at another ...
1
vote
1answer
37 views

Unable to make a really basic sketch work

I've been learning how to encapsulate my code within functions, and one of the examples I worked on is a simple INPUT_PULLUP button. When I upload the sketch from the arduino website everything works, ...
1
vote
1answer
65 views

How to wire and control a 16mm button with 2 legs using arduino?

I can't find any tutorials online explaining how to wire and control a 16mm push button like the one in the picture: Do you have any suggestions as to how use it with an arduino or a raspberry pi?
7
votes
7answers
15k 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)?
1
vote
0answers
29 views

How to make my sensor reads when i pressed the button

Hi I'm making a digital fare meter, I have a problem in how my sensor reads when I'd pressed the button(single tap). I need the sensor to read once I pressed the button because when I press the button ...
1
vote
0answers
25 views

Arduino Button switch LED without reset delay [closed]

trying to get a little helper working. Two LEDs, each one is on for 24hrs. Only one is on at the time. There should be a button to switch the states of the LEDs without restarting the delay. Example: ...
1
vote
0answers
94 views

Using AccelStepper to move a set distance while a button is held down

I'm working on a project and using a nema 23 stepper motor and driver. Need to be able to move the stepper 1/32 rotation when I press a button. I need a small delay so I have time to release the ...
2
votes
2answers
78 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:...
0
votes
1answer
73 views

Connecting a push button to a stepper 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'...
-2
votes
1answer
59 views

Push button restarts the arduino [closed]

I have linked an external push red colored button to my arduino but when I press it, instead of giving me HIGH or LOW, it resets the arduino. I am a beginner to this stuff so could someone help?
0
votes
1answer
102 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
0answers
61 views

Problem in interfacing esp8266 with Arduino ide for simple blink program

Arduino: 1.8.13 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory,...
1
vote
0answers
34 views

Will this be possible to do before I even get started. I want to automate my house window [closed]

I will have 2 buttons. Using Adafruit DC Motor Driver https://www.adafruit.com/product/3190 Top button is a function, bottom button is mode. The top button functions. Window 1: Single press will turn ...
1
vote
2answers
136 views

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 ...
2
votes
2answers
54 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 ...
1
vote
1answer
47 views

Question about button circuit

I'm quite a beginner at electronics, but thought I would try venture into it. Currently I'm working on a project where I need to reuse a button module salvaged from some old hardware, but I can't ...
2
votes
1answer
47 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 ...
1
vote
1answer
169 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 ...
2
votes
1answer
73 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 ...
-1
votes
1answer
48 views

Arduino waits until button release to activate

I'm fairly new to arduino, and on my own I'm trying to move a servo to the left and right using 2 buttons. I've got it working for the most part, however when I hold the button down nothing happens, ...

1
2 3 4 5
7