Questions tagged [button]

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

0
votes
0answers
19 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
62 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
9 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
54 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
44 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
27 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
21 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
48 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
30 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
30 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
34 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
16 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
30 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
26 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
37 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
90 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
42 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
684 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
70 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
90 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
39 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
170 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
205 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
198 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
454 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
49 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
103 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
118 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
130 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
405 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
31 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 ...
1
vote
0answers
37 views

How to disable the possibility to push activate again a button after being pressed one time [closed]

I have a project of a pill dispenser and I would like to activate the mechanism to let the pills fall down with a button. After being pressed I would like to deactivate the possibility to press ...
0
votes
1answer
454 views

Arduino DC motor with 2 buttons

I have a problem with my Arduino project and I tried everything to fix it but nothing helps. I am trying to rotate my DC motor with two buttons: one button is to stop/start rotating on left side, ...
0
votes
1answer
60 views

How to regulate a led on-board? [closed]

There is blink project consisting 3 sections: 1 - regulation of the led brightness using a potentiometer 2 - whenever: the button is pressed - the led is on - the button is released - the led is ...
1
vote
2answers
222 views

Button to exit a running loop

I have a very basic circuit setup: A button connected to pin 2 An LED connected to pin 9 Desired Functionality: When the button is pressed, the user can toggle through 4 LED patterns. The ...
1
vote
3answers
820 views

Push button control of multiple relays

I'm new to arduinos and have not been able to find/create a working bit of code for my project. I'd like to control several different relays (standard 5v optical relays) with push buttons. I want one ...
0
votes
3answers
169 views

Need help with a program for a button to change the display on an OLED display

So I am programming an OLED display from my Arduino Uno. I am trying to have a button that switches the different words on the display. (The words are just placeholders for programs as of now.) My ...
0
votes
1answer
142 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
1answer
166 views

Button Matrix Code and Wiring [closed]

Bear with me here, I'm new to arduinos, so what I'm saying might only make sense in my own mind. I'm trying a button matrix and I not completely sure on my wiring and I have a few questions. Is the ...
0
votes
1answer
361 views

need help in code to send sms to multiple contacts using arduino, gsm800, push button [duplicate]

When button 1 is pressed, the message should be sent to 4 members. But we are receiving the message for one member and after some delay for the other members. But receiving to all members of contacts ...
1
vote
1answer
491 views

Rc car controller using the RC-switch library

simulate this circuit – Schematic created using CircuitLab (Newbie in arduino) Hi so i have a project which involves creating an rc car which uses the 433Mhz rf module and an arduino nano with ...
-1
votes
2answers
80 views

Button Switch arduino

I'm trying to use my button as a switch (the led goes on after I push the button and the led goes off when I push the button again). I know I have the right circuit, because I also used a code from ...
0
votes
1answer
68 views

Power management circuit

i'd like to have a esp-01 powered on and controlled with a push button only. so imagine the device is off, the user press the momentary push button. in the setup the esp8266 turn on a mosfet or ...
0
votes
1answer
325 views

Arduino - Calculating the time for which a Pushbutton is pressed and held without being released

I'm working on a project that requires calculating the time for which a pushbutton is kept pressed without being released. Is there a code snippet that i can use for this particular need ?
0
votes
2answers
734 views

Arduino - Button to start / stop loop

So basically I'm trying to create a device where when I push a button it starts a loop. When I push this button again, it stops the loop. Right now I have it logged to serial. It starts up correctly ...
4
votes
2answers
124 views

Interrupts: use of the “volatile” keyword with a structure pointer for button debounce

I've written a small sketch targeted at the Arduino Uno (ATmega328P) to debounce a mechanical pushbutton using the summing/integration technique: #include <IntegratingDebounce.h> #define ...
0
votes
1answer
4k views

OneButton with pins A6 and A7

I noticed that OneButton library does not work with pins A6 and A7 (with A1 and A2 it works good) on my Arduino Nano. Is it because A6 and A7 are Analog only? There is possibility to make them work ...
-2
votes
1answer
33 views

currentbuttonstatus [closed]

I'm trying to use momentary push buttons to switch bi color LED between RED and GREEN. I've got one working, but when I try to adapt the code for more buttons, it doesn't work. I'm just changing the ...