How to Make One Button Have the Functionality of Two or More with Arduino

preview_player
Показать описание
🤩 FREE Arduino Crash Course 👇👇

***If you like this, I think you'll like the premium Arduino training we offer. Check it out here***

We designed this circuit board for beginners!

SHOP OUR FAVORITE STUFF! (affiliate links)
---------------------------------------------------

Get your Free Trial of Altium PCB design Software
We use Rev Captions for our subtitles

Arduino UNO R3:

Budget Arduino Kits:

Multimeter Options:

Helping Hands:

Soldering Stations:

AFFILIATES & REFERRALS
---------------------------------------------------


FOLLOW US ELSEWHERE
---------------------------------------------------

*Follow This Link to More Resources:*

*Further Reading:*

Do you have an application where you want multiple buttons for different user inputs? Maybe you have a timer and you want one button for minutes and another for hours.

But there is a problem – you only have room for one button!

In this tutorial, we are going to use Arduino to explore how to make one button have the functionality of two or more.
Рекомендации по теме
Комментарии
Автор

I am using this code to change numbers on a seven segment display and it didn't seem to be working too well until I changed the while statement from "while (digitalRead(buttonPin) == LOW)" to "while (digitalRead(buttonPin) == HIGH)". After that it worked perfectly. Thank you so much for your help!

michaeleva
Автор

Your videos are some of the best on YouTube. The way you present the information, the detail you go through to explain every part of the code is just EXCELLENT. I hope to learn from your style when I make videos. Won't ever be as good as yours, but I can hope!!! Nice work!!!

thunderbolt
Автор

This helped me out a lot with my menu scrolling script, so I no longer get the skipping due to longer key presses. Any press between 10 and 3000ms now count as one step in the navigation.
Thank you very much, this is a great video!

Jenachy
Автор

Thank you so much for this amazing information! I just successfully finished my first complex control structured algorithm and project. Thanks to your videos. I've been watching your videos every day for about a month now. And I can now program a device to use several buttons that does many different functions based on many inputs. My next goal is to add an LCD screen to the project. And with your videos, I'm sure I will accomplish that goal in no time. Thank you so much. 🙏

tbwpf
Автор

This video may seem to be old 8 years back but helpful until tomorrow. Thanks for the video.

ipyanamwaisekwa
Автор

really appreciate this, I managed to apply this logic to my application using a sensor switch by just changing the while loop signal to HIGH. Really appreciate this. Thanks so much :)

crouchingchicken
Автор

Good video and good explanation. It will be great to add a delay time to set the led on for certain time. Than it can be used for garage door opening

chbonnici
Автор

Profesional explanation....mill gracias....me estás ayudando mucho.

tarikazizi
Автор

I was wondering why mine wouldn't work, but then I remembered the Pomegranate. I went out and bought one, put it on the desk next to me and my Arduino and it still didn't work? Turns out the pomegranate wasn't ripe so I had to go out and get another one. I got a ripe one, put it on the desk next to me and surely it worked! Somewhat annoying that the pomegranate must be ripe but otherwise great tutorial!

Mike-zlzs
Автор

You're a lifesaver great video as always

phoperdox_sore
Автор

Thank you! The level of detail and explanation in your vid is phenomenal.

SlNlSTR
Автор

This is helpful. Thank you. I was going to add two buttons to my project, but now I'm smarter and only need one!

By the way, what program are you using to design your breadboard diagrams. I'm taking actual pictures to remind me and figure things out. It's a messy process and would love to use a program to do that for me. Thanks.

ScienceNotFaith
Автор

hi P.E.A. (Programming Electronics Academy) hope the short is good for you :p
Thank you for this amazing videos and tutorials!!
Hope i can see more of them in future

saskokarabojoski
Автор

I was able to extend the count for the button presses and add a short one to reset/turn off the LED's.  I also removed the Serial command so I could push to one of my attiny85's I seem to like.  I'm thinking of creating a circuit to include to relays instead of the LED's so I can use one button on a motorcycle handlebar to control two external light circuits (driving and fog lights perhaps).  Medium press to turn on one circuit, longer press for second.  Somewhat quick press turns off both.  Thanks again.

NMrick
Автор

I looked at the thumbnail and went "man, I can burn an arduino with 1 button?"

mattroh
Автор

Nice video - THX !

I would prefere NOT to use delay() and instead check the 'delay-time' against the current time in millis() - right ?

keldsor
Автор

Do not use delay (if you use more buttons it will not work right?) i use: in the loop unsigned long currentMillis=millis(); if((unsigned long)(currentMillis - btn1previousMillis) >= btn1interval){//handle led and pressed boolean (overflow safe) }

runboyjk
Автор

you can also mutiply antrance with logic gates, there are some devices ready for it. I think sn74hc595n. multiply 3 to 8

lexclock
Автор

AWESOME, i little doubt, doesnt the current in the circuit run from positive to negative, so im not sure why the resistor is connected the other way

richardrex
Автор

I have 2 questions;
1. How do you write a program to create a double click function on the button to have the motor turn a certain amount of degrees, hold it as long as you hold down the button, than rewind back the exact way when you release it?
2. Could and how do you program/solder that circuit into smaller arduino models?

gerrekurquidez
join shbcf.ru