Questions tagged [button]

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

Filter by
Sorted by
Tagged with
-3
votes
4answers
107 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
50 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
33 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
55 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
61 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'...
0
votes
1answer
22 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
36 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
38 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 ...
0
votes
2answers
41 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
68 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
29 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
116 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
38 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
46 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
127 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
35 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
360 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
88 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
110 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
26 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
46 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
34 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
19 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
129 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
99 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
99 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
139 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
87 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
34 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
1answer
136 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
53 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
24 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
333 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
301 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
56 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
104 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
41 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
39 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
60 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
38 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
29 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
381 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
44 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
45 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
38 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
24 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
40 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
31 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 ...