Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [button]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
41 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
74 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
18 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
29 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
32 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
18 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
89 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
59 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
66 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
67 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 ...
0
votes
1answer
76 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
0answers
26 views

Arduino Uno - Stepper motor not working with button

I am completely new to Arduino, and all sorts of hardware and software. I have a stepper motor, which I want to rotate by a number of rotations when I press a button, and then go backwards by a number ...
1
vote
2answers
112 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 ...
0
votes
2answers
49 views

How to run 3 mode of operation for each operation has individual push button to select the mode in Arduino?

I need to run 3 modes of operation if 3 push buttons are pushed in arduino. I have made the initiate code logic for one push button and one operation but I got an error message of "redefinition of int ...
0
votes
0answers
23 views

How do I have this audio and LED activate ONLY when a button is held using an Arduino?

I have this code that I am using to play a sound effect where I used a program called wav2c to convert a .wav file to number values that I put into a header file that I use in the code to generate the ...
0
votes
2answers
119 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 ...
2
votes
1answer
62 views

Arduino Timer with increase time button

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 ...
0
votes
0answers
37 views

LCD on top of SD datalogger flickers help!

I have a problem with my 16,2 with buttons lcd shield.(LCD Keypad Shield). It is connected on top of an SD dataloger. I came to the conclusion that every time the sd shield logs data and completes the ...
1
vote
1answer
92 views

Garage door button with delay feature

I am working on an art project that involves a garage door opener. I am very new to Arduino, and electronics. I have a starter kit with a ton of accessories. The garage door opener has 2 screws (...
-1
votes
1answer
36 views

One Led and 2 buttons [closed]

I need to switch on led with pushing button number 1 , and during 3 seconds it should stay on, and if I push button number 2 during this 3 seconds led should turn off. In other case after 3 seconds ...
0
votes
0answers
17 views

Communication using two HC05 modules

I'm working on a project that consists of sending data from flex sensors from a master Arduino to a slave arduino that uses that data to control servo-motors. I am trying to start slow and just ...
2
votes
2answers
59 views

RGB LED Mode toggle - Trying to avoid using main loop()

I'd like to start by saying that I have only been dabbling in electronics (not just Arduino) for about 3 days now. I am trying to write a sketch which changes an RGB LED when a push switch is pressed....
0
votes
1answer
45 views

Can a Arduino Uno handle all these components?

Its my first project with an Arduino, so please bear with the dumb questions. For this project of mine, I need an Ultrasonic Sensor, a Gyroscope, a Buzzer, three push buttons and an 16x2 LCD. Can ...
0
votes
0answers
13 views

How to wire an lcd and a button [duplicate]

Anyone know how to wire a lcd with a button to react when the button is pressed and print on the lcd
-1
votes
1answer
31 views

Code and wire a LCD and button [closed]

I need to code and wire: “Button is pressed.” to an LCD screen when a button is pressed. When the button is released, the LCD should display, “Button is released.” NEED HELP!!!
1
vote
1answer
24 views

Press one button then another?

Let's say we have two buttons - button 1 and button 2. What I need to do is to do something (like turn LED on) when button 1 is press, then button 2 is pressed. I can do it realy simple by just using ...
0
votes
1answer
164 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 ...
0
votes
1answer
37 views

Why my servo motor is always on?

Why my servo motor is always on? #include <Servo.h> Servo myservo; int pos = 0; void setup() { pinMode(2, INPUT); myservo.attach(9); } void loop() { if (digitalRead(2) == LOW) { ...
0
votes
1answer
42 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'...
0
votes
1answer
37 views

Make one button print different sentences on LCD

I am very new to arduino and I've been scratching my brain on how to make one button print out three different sentences. When I press it the first time, a " I am " is suppose to appear, when I press ...
0
votes
0answers
22 views

How to stop and repeat a melody using a button?

How can we make our melody stop when we press the button the first time and repeat the melody when we press the button the second time? // Noterna defineras #define NOTE_B0 31 #define NOTE_C1 33 #...
0
votes
1answer
32 views

Two buttons, one LCD

I'm trying to make a program that whenever a button is push, a different word will show on a lCD screen. However, it seems that the two buttons provide the same output ("Screen A"), it's like there is ...
0
votes
1answer
29 views

Need help with buttonstate

I'm creating a program that works like a piano. I have four button, a piezo buzz and an LCD screen. I'm having a little trouble with the buttonstate. Here is my program, when I run it the piezo buzz ...
1
vote
1answer
53 views

Getting gibberish serial port until button is pressed, plus the button is turning the leds off instead of on

I'm connecting a button to ESP8266. Connection goes like this: 3v to one side of button, other side connected with GND and pin number 2 (no resistor). Every time I connect the ESP both built in LED's ...
1
vote
2answers
107 views

Why does current flow along a wire instead of a resistor right next to it? [closed]

I am having trouble understanding exactly what is going on in a circuit where when a button is pressed an LED goes on. Also, I have the Arduino UNO. The schematic can be seen at: 2:36 of this video: ...
0
votes
1answer
107 views

PWM Control, How to stop LED from Flickering?

What is required is controlling the brightness of an LED using both Buttons and a Potentiometer, Button A: Increase Button B: Decrease /Dim Potentiometer: Increase and Decrease, This however must ...
1
vote
4answers
741 views

changing state of an LED using a pushbutton leads to unstable result

I am trying to run this code: const int buttonPin = 7; const int ledPin13 = 13; int buttonState = 0; int lastButtonState = buttonState; bool flag = true; void setup() { // ...
0
votes
0answers
146 views

ESP8266 /ESP12F use flash button as input without using loop()

I couldn't find a proper answer anywhere on internet. I want to use the FLASH button as input in the setup() function and do not use the loop() with deepsleep mode (this part comes later). I tried ...
3
votes
1answer
96 views

Code test the duration press of the button

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; #...
0
votes
1answer
51 views

1st LED turn ON when 1st button is pressed and other LEDs remaining OFF

I have 2 LEDs and 2 buttons. What I want to code is when first button pressed the 1st LED turn on (stay on for 5 seconds) and 2nd LED remain off, and same if 2nd button pressed the 2nd LED turn on and ...
0
votes
2answers
243 views

Combining 2 sensors in one code with 1 push button

I am trying to create a circuit with one tactile pushbutton, and LCD and two sensors: 1) temperature, and 2) pulse sensor. When the circuit is on, the LCD initially shows the reading from the temp ...
0
votes
0answers
310 views

Nested “switch” statements menu

I know that menus were discussed perhaps a thousand times here and everywhere. But using a ready solution is not something that I'm looking for because I know I won't learn the concept if I use them. ...
0
votes
3answers
662 views

Do I need a pull-up/down resistor for button LED circuit?

When reading up on how to make a circuit that turns an LED on when a button is held down, I keep finding people saying a pull up or down resistor must be involved, to avoid the flickering state of the ...
1
vote
0answers
677 views

Stepper Motor button control with A4988 Driver

So I'm quite new to programming and have inevitably worked myself into a corner. What I am trying to accomplish is to allow for a stepper motor, (powered by an A4988 driver) to move with the push of a ...
-1
votes
2answers
51 views

Confusion between switch and if?

Following code is to control two LEDs for on and off by two dedicated push buttons. I have used if() for each condition and I was not comfortable writing this code, as I could feel, it can be better ...
0
votes
1answer
213 views

Arduino button-controlled LED with AVR Assembly

I am trying to make a simple button-controlled LED, but I cannot seem to get any input from the button that would change the state of the LED. In other words, the program keeps branching to lighton, ...
0
votes
1answer
175 views

Controlling LED and Button with single pin

I am trying to use an ATTINY85/Ardunio Uno to turn an LED on and listen to a button input. I don't mind if the LED turns on when the button is used. I am have found this thread from a couple of ...
0
votes
1answer
201 views

How to fix this code so instead of having to hold button to change led, you can press?

const int buttonPin = 1; // the pin number of the pushbutton input pin const int ledPins[] = {2, 3, 4, 5, 10, 11, 12, 13}; // variables will change: int buttonState = 0; // variable for reading the ...
0
votes
1answer
524 views

Problem with Pulse Sensor signal

I'm making alarm with input from pulse sensor. When it detect high heart rate then it send a text message. Everything works fine when i am using potentiometer (as input) for simulating triggering SMS. ...
0
votes
1answer
32 views

How to create objects with their own variables? [closed]

So i created a class and when i created objects and use them, they seem to share their variables between each other ( the currentReading, previousReading and the time variable). how can i create ...