Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [button]

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

0
votes
0answers
23 views

Pause and resume logic using single pushbutton

I am able to stop the logic using a pushbutton. However, I would like to pause and also resume with the pushbutton instead of stopping.( When pressed once, pause for 5 min and when pressed gain resume ...
0
votes
1answer
47 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 ...
0
votes
0answers
24 views

Joystick button press misses with reading xy-axis ADC values?

I'm developing the basic function to work with the joystick module, so I have to: 1. Read x-axis ADC value. 2. Read y-axis ADC value. 3. Read the logic button press. The problem is that I misses the ...
1
vote
3answers
78 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
46 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
81 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
34 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
71 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
63 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 ...
0
votes
0answers
45 views

Can I manually turn on and off the interrupt timers?

Can I manually control(on and off) the interrupt timers of an Atmega328p chip with a push button? If yes, can it be used in compare match mode or input capture? if someone post some examples then it ...
-1
votes
2answers
74 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
33 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
78 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
71 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
65 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
0answers
33 views

Push button storing in array and display sequentially without debounce

I would like to read 6pushbutton values from analog0 pin and store it in a array . And print them sequentially My project is to make a bot that could store the input commands (right left forward ...
0
votes
1answer
649 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 ...
0
votes
1answer
19 views

attachInterrupt for mega 2560 not triggering

I recently bought a mega 2560 to toy around with as a hobby. It's pretty fun so far, but I've recently gotten stuck while trying to use attachInterrupt with a button. I'm using the CHANGE mode, and ...
0
votes
1answer
53 views

Need help with using LED matrix with pushbuttons

I am building a small project that uses a pair of 8x8 LED matrix (driven by the MAX7219), a pair of SG90 servos, a HC-SR04 ultrasonic sensor, a 16x2 LCD (Hitachi HD44780 driver), some push buttons and ...
0
votes
1answer
47 views

Trying to read the current position of a flex sensor and store it as a variable? NANO ATmega328p

I am trying to write a code to read the current position of a flex sensor when a button is pushed and use that data to pulse a piezo. I set it up to read the flex sensor and to alarm when it gets 100 ...
1
vote
3answers
146 views

Using attachInterrupt() to make a reset button for my code?

I have used attachInterrupt() to reset my program to the beginning. It actually interrupts while running the 3 states as shown below inside of the if statement but when I press the actual button it ...
0
votes
1answer
26 views

Servo speed in a Toggle Code

I am new to Arduino and am trying to figure out servos. Right now I have a toggle button code for the servos. Although I want to know how to speed them up. Is there a way to do this? Currently, this ...
0
votes
1answer
65 views

Capacitors, Arduinos and Saving Data

In short, I have programmed and wired a speed/odometer and all is working well. However, I need to save data from the components/sensors once a power button is pressed, which has led me down the road ...
0
votes
1answer
35 views

Best method of detecting peg in hole [closed]

I’ve got a large wall with 1” holes scattered about. I’ve got some wooden pegs that fit perfectly into these holes. Now I’m thinking of creating a light installation based on the pegs, but i’m ...
-1
votes
1answer
36 views

Press button and Send Message Error

The problem is that sometime I don't even need to press the button and it sent message and keep on sending continuously. What I want to do is that once the button is pressed, sent 1 message. I ...
0
votes
2answers
69 views

Comparing button presses to correct sequence

I am creating a memory game with the Arduino. It has four buttons, each for a different colored led. The leds will blink in a random sequence and either fail or add another light in the next sequence ...
0
votes
1answer
24 views

Button isn't working properly

I am new in arduino trying to make race game. My problem is that my button (all buttons) is working sometimes and sometimes not. I am pretty sure that it's because of my code. Could you please help me ...
0
votes
3answers
47 views

Detect button press inside a for() cycle

I was working on a project with an LED strip, where I'd like to cycle through various effects with just a press of a button. The problem is that I don't know how to detect the press of the button to ...
0
votes
1answer
61 views

How to add a pedestrian button code to a traffic light with ultrasonic sensor?

So I have a project to create a 2 set of traffic lights which would detect a car coming and stopping on the ultrasonic sensor and my code would allow the traffic lights to loop and let the car through....
0
votes
0answers
24 views

Why won't this “Simon Says” sketch accept button input?

I tried to create a "Simon Says" game with Arduino, 4 INPUT_PULLUP type buttons and 4 leds. The random sequence generating part apparently does the trick, but the same can't be said for the "input ...
1
vote
1answer
48 views

My Arduino keeps telling me the button is being pushed

My code is simple simple for the button. There is no reason why this shouldn't work... I think. I honestly have no clue what's wrong. Output: Code: #include <SPI.h> #include <MFRC522.h>...
0
votes
3answers
533 views

Debouncing Multiple Buttons

I'm creating a binary calculator with my Arduino. This will take two different binary numbers and add them together. I am focusing right now on the Byte One Input screen. For this, I can use two ...
0
votes
0answers
53 views

Arduino debounce understanding

So I have this debounce code. I did some research to learn how this works but I couldn't figure it out. Can someone explain me how this code works? I have basic knowledge of C++. int pinButton = 7; ...
0
votes
1answer
33 views

Steppers only vibrate, not rotate with I2C

The goal of my project is to be able to control two steppers with 4 buttons. Steppers are connected to Adafruit Motor shield(the older one) which is stacked on Arduino UNO, buttons are connected to ...
0
votes
1answer
178 views

Arduino UNO(master read) + NANO(slave write) i2c buttons+stepper

First of all, I'm new to arduino. Check the EDIT line below the two codes. I have connected motor shield to arduino uno. Connection between the two arduinos are A5 to A5, A4 to A4, 5V to 5V and GND ...
0
votes
1answer
39 views

Arduino - Push Button State Problem

My problem is I want the buzzer to stop after a certain amount of time, regardless if it is still pressed or not. I have tried to implement a boolean statement to the code but to no avail(I'm not ...
1
vote
2answers
58 views

Can I change this code to use a potentiometer instead of a push button [closed]

The following code is for a pyrograph power supply that uses an ATtiny85. I want to change it, so instead of a push button I have a potentiometer being the control of the temperature. Can anyone guide ...
1
vote
1answer
51 views

Buttons, LOW vs no connection

I'm working with a very simple circuit to understand push buttons. The code in the tutorial uses the INPUT_PULLUP pinmode. I understand the idea of the pinmode, but I have two questions: There must ...
-4
votes
1answer
57 views

Using C - How do I make my button press nearly instant without using interrupts [closed]

How can I make the press of a button nearly instant, WITHOUT using interrupts or millis() - and NO preset arduino functions, just C. There is a delay at the end of my while loop of 500ms - perhaps ...
0
votes
1answer
314 views

Sharing serial Rx to read a push button on ESP8266-01

I'd like to know if it's possible, and if so how to use the serial Rx pin in a shared way to read a push button? I've seen people using it in sort of a dedicated way but my idea is to use it ...
0
votes
0answers
118 views

Push button to LED Code does not Properly Execute

I was making a program that would randomly select an order of lights utilizing the random-seed and random functions in Arduino. After selecting an order randomly, the LEDs would proceed to go off ...
1
vote
1answer
65 views

Basic Arduino Question. Trying to turn off leds turned on through the serial monitor by using a push button

I'm new to using the serial monitor. I have a code set up so that LEDs turn on when I type an input on the keyboard. I know how to turn them off using a keyboard but I and can't figure out why the ...
2
votes
3answers
4k views

Detecting if a push button was pressed and released

I want to detect if a push button was pressed and released again. So I thought the right approach would be to first wait while the pin yields LOW and then wait while the pin yields HIGH: void push(...
0
votes
2answers
385 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
3answers
1k views

Change the sequence of LEDs with button press

I am new to arduino. I have created a circuit , here is the image: I want something that as I press the button the sequence of LEDs will change and as I press the button again , the sequence will ...
0
votes
3answers
49 views

Combing two codes to make it work on the same time but not affecting the other code?

I am trying to make a game where there are arrows going towards an object (in this case I printed x) and you have to evade the arrows. When you press the button it is supposed to print x on the top ...
-1
votes
1answer
75 views

Concave button wiring with Arduino

I am new to working with Arduino and I have a basic question. I have an entire circuit set up and functioning, but I would like to add an arcade style button (Larger concave style) like this. So my ...
3
votes
1answer
2k 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
vote
1answer
77 views

Help with multi function momentary buttons

I'm using the PunchThrough Bean and trying to build a two button project that has multiple functions. The idea is the user can press button 1 or button 2 for either short or long presses, or they can ...