A button is a simple input component which responds to being pushed by a user.
1
vote
2answers
28 views
How to I press a button once to display text and again to remove it?
My code is displaying voltage and I want to have a button that when pressed it displays a text and when I pressed it again it would turn off the text. I put the word "YES" just for a test
float vPow =...
-5
votes
1answer
32 views
Arduino Skill Stop Push button error
I made a skill stop game from Arduino Uno and a pushbutton.Here is the code:
byte led_one=2;
byte led_two=3;
byte winner_led=4;
byte led_four=5;
byte led_five=6;
byte pushbutton=12;
byte score=0;
int ...
0
votes
1answer
22 views
Servo Control using Pushbutton
I was trying to build a system that when the user pushes the button, the servo rotates 45 degrees and than returns back to zero. This system is going to be duplicated as there will be two servos and ...
3
votes
2answers
107 views
Hold a random number
I am trying to create a code that has at least 6 servos attached and two buttons for a two player game. I want to be able to roll a random number and have it hold that value then when it is that ...
0
votes
2answers
41 views
digispark - 2 pin push button to iterate through an hashmap
I'm trying to create a project with my digispark where i can iterate through an hashmap, when i press the push button the digispark writes via digikeyboard the values from an hashmap. Each time i ...
0
votes
3answers
54 views
use button to select variable
i have a need to use 3 buttons a a simple option/variable selector at sketch start up ...
Pretty much at startup , script must wait for button press ( one of 3 ) , when button is pressed , use that ...
0
votes
2answers
61 views
Help Improving Debouncing
In short, I am attempting to debounce several buttons using something like a while loop instead of delays.
This code runs in a box with a series of buttons on it, if the correct sequence of buttons ...
3
votes
2answers
65 views
Update variable using buttons
I made a part of code to change the temperature limit for alarm system. On warm days user have to change the temperature limit with buttons and OLED display.
The question is: How can the variable ...
0
votes
1answer
30 views
OnKeyPress in a arduino
So, I have 3 buttons to a arduino.
I want to detect the button press on the 3 of them.
For that, i've created a function:
int OnKeyPress (int port) {
int LastState, BeginState, r;
r = 0;
...
2
votes
1answer
69 views
Use transistor to press button on external device
I have a small device with a simple push button. I'd like my Arduino to be able to make the device register button pushes. It seems like the best way to do this is to use a transistor to close the ...
0
votes
2answers
75 views
How to count the number of button press then play sequence..?
when i press the button once, sequence s1() play.
when i press the button twice, sequence s2() play.
when i press the button thrice, sequence s3() play.
when i press the button 4 times, ...
0
votes
0answers
199 views
Connecting to WiFI through WPS (ESP8266 Sparkfun Shield)
I'm trying to connect my arduino to my wifi network using WPS
push button but I'm not sure how to set it up. There are no examples of this in the library and some googling didn't reveal anything ...
0
votes
3answers
56 views
Why isn't this pushbutton program working?
Here is my circuit:
and here is my code:
int LED = 13;
int BTN = 7;
void setup() {
pinMode(LED,OUTPUT);
pinMode(BTN,INPUT);
}
void loop() {
if(digitalRead(BTN) == HIGH) {
digitalWrite(LED,LOW);
}
...
0
votes
0answers
60 views
Button interruption using ESP8266-12
i'm trying to use a button interrupt on gpio5 of the ESP8266-12 but i have a problem that the interruption didn't work . is there someone who tried this and can help me ? this is my code .
# include ...
0
votes
1answer
53 views
Homemade fan - motor madness
i hit the forums again with my homemade fan idea, this time i got the right servo. everything works fine until i try turn up to the 2nd speed of the servo, the buttons just go mad and the response in ...
0
votes
4answers
107 views
Can I make so when I press a button on my Arduino Uno board, it will press a key on my computer? [duplicate]
I looked up the question before, but they only gave answers for boards that are not the Uno. Is there any way to make it so when I press a button on my board, it registers as a key press on my ...
0
votes
1answer
24 views
Servo Speed Changer with Buttons
ok so yesterday i was in trouble with the buttons, with help from you i got over it and everything worked fine with the 1st speed of the servo, then i added the other 2 speeds and it looks like it all ...
0
votes
0answers
30 views
Button used to add or substract from “x”
I'm using an Arduino UNO and im trying to make with 2 push buttons 3 diffrent speeds for a motor. I started with the base code for the buttons and then im gonna add the motor but i kinda got in a bit ...
0
votes
1answer
98 views
Stepper Motor Button Press
I am having difficulties programming what should be a simple sketch that gets my stepper motor to run at one step per second indefinitely at the press of a button and then stops at the press of ...
0
votes
2answers
54 views
Where can i get touch sensitive buttons with RGB-LED like in Ableton Push
I am searching for this component: a touch sensitive button with LEDs like in the Ableton Push or in other Launchpads. Does anyone have an idea about where I can buy something like this? The best ...
0
votes
2answers
87 views
How can I make push buttons react to being pressed instantly?
I am making an Arduino alarm clock. I am checking for the state of a button. If it is clicked, I increment the button counter. If the counter is divisible by 2, it is mode 0, if not, it is mode 1. I ...
0
votes
1answer
72 views
Button Relay Control
How can I fix this sketch to make it so that once the button is pressed, it performs some action for a certain amount of time and then returns back to a low state until it is pressed again. For ...
1
vote
3answers
59 views
80 Apple Homebuttons and a steppermotor [closed]
I am graduating in a month and I want to make an installation with 80 apple homebuttons which are connected to a stepper motor. The idea is that each button that is pressed, turns the stepper motor ...
1
vote
1answer
69 views
Trouble using lcd.readButtons() in RGBLCDShield library
I am trying to create a state machine that loops in whatever state it's in until a button is pressed. I am using the Adafruit_RGBLCDShield library along with the LCD shield and 16x2 display. For ...
0
votes
1answer
38 views
Standard Arduino kit button caps?
Are there any caps available for these buttons, or am I better off using other, more stylish buttons if I want to make a presentable arduino-based gadget?
The circular hole drilled in their square-...
1
vote
2answers
839 views
How to turn two LED's on and off with one button?
I was wondering how to write a code that would do this, WITHOUT using IF and ELSE: when the button is pressed, one LED is on and the other one is off, but when the button is not pressed, the LED that ...
0
votes
2answers
717 views
press windows key using keyboard.press();
Is it possible to allow an arduino Leonardo to simulate pressing the windows key using the keyboard.press(......); command? If so, what is the required value?
0
votes
1answer
31 views
upcoming voltage from a button
i use this simple code for arduino :
const int buttonPin = 2;
const int ledPin = 13;
int buttonState = 0;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
...
1
vote
3answers
289 views
Breaking a switch case from an ISR
I'm struggling with something. My CPU sits in a switch case state machine like this:
switch(expression) {
case constant-expression_1 :
statement(s);
break; /* optional */
case ...
0
votes
1answer
44 views
Disable other buttons while one of buttons is pressed
I'm making a project with three buttons. What I'm trying to do is to disable other buttons (make them not respond to a click event) when one of three buttons is pressed.
For now I have this code:
...
1
vote
1answer
24 views
Not being able to use pushbutton
I've been trying to detect a push button based on this tutorial, but due to my lack of skills/knowledge I haven't been able to make it work, could you guys point out what I'm doing wrong?
Any help is ...
1
vote
1answer
38 views
Why is my LED blinking?
I have this simple push button schematic:
The idea is that the LED is on as long as the button stays pushed, with the switch closed.
The code is below:
int ledPin=10;
int switchPin=5;
void setup()...
0
votes
1answer
57 views
Trying to start a timer to change lights when a button is pressed
I am trying to setup a series of lights (traffic lights) that change based on a timer that begins when a button is pressed. The goal is to use the lights to track how long its been since you pressed ...
0
votes
1answer
76 views
IR remote unstable button numbers
Question
Is there a reason for unstable button numbers of an IR remote?
Desciption
I wrote a remote class where I identify the pressed number of the remote to set states. But however I get never ...
1
vote
2answers
108 views
Why is my pushbutton always reading LOW?
I know this is ridiculously simple task but I spent the last two hours trying to get this to work and it is not working. I don't have an Arduino but I have an ESP8266 Huzzah Feather which is ...
0
votes
3answers
31 views
Only return button state once in X amount of time?
I want to detect if a button has been pressed, but what I don't want is for it to keep returning the "pressed" state more than once within a second or two.
For example, with this code:
void loop() {
...
0
votes
1answer
306 views
Integrating 2 push buttons to toggle the LED ON and OFF
Hey guys need your help in verifying out this program about toggling the LED ON and OFF using 2 push buttons.What i actually want is to let my LED stay ON when i press and even leave the push button-1 ...
1
vote
1answer
101 views
LED and LCD game
I am making a game where four different colored LEDs are flashing randomly, and when the green LED lights up, the user presses a button. If the user pushes the button when the LED is green, I want my ...
0
votes
1answer
247 views
How to get a button state change within a for loop?
I have a for loop inside my void loop() that triggers a piezo.
What I want to happen is when I press a button, it breaks the loop of the piezo, but right now, it's as if it isn't detecting the button ...
1
vote
1answer
143 views
Arduino metronome - Change time signature on button press
/**************************************/
const int lowestPin = 1;//the lowest one attach to
const int speaker = 13;
int ts = 4;//how many beats you want
int count = 1;
const int keyPin = 12;
int ...
-1
votes
1answer
83 views
Arduino LiquidCrystal_I2C fast overwritting
I have an arduino board connected to 2 temperature sensors, 2 switch buttons and 1 lcd display.
When the switch button changes to off, "off" is printed on the lcd display. When the button state is on,...
1
vote
2answers
165 views
Detect how long a push button is being pressed?
I would like to detect how long the state on/off is going on for. Is there a way to do that? I would like to do that for two reasons:
I would be able to make a very simple toggle button. (I know ...
0
votes
1answer
125 views
How to change Void with button press
I have 2 buttons and 2 voids (blink_slow) (blink_fast).
i need to be able to press button 1 and blink-slow void will run, then press button 2 and blink fast will run. none of my code works, any idea ...
0
votes
1answer
50 views
Changing how a longpress is executed
I have an RGB LED common Anode attached to my Uno and this code detects a long press to turn the LED on and off. Short presses cycle through colors, then off.
The problem is that a longpress is 2+...
3
votes
2answers
110 views
Arduino with multiple buttons - will power be an issue?
I have a, hopefully simple, question related to creating a circuit with an Arduino board; feel free to dismantle the idea, I'm, unfortunately, not well-versed in electronics.
I have a spare Arduino ...
1
vote
4answers
244 views
Why doesn't this debounce function work?
Edit 2
I made a function that works, but I'm still confused about just one thing...
I'm very confused about how variables work in C++.
In this program...
boolean debounce(void)
{
static ...
1
vote
1answer
513 views
What is the correct way to wire a piezzo buzzer with a potentiometer and a button?
I'm working on a morse transmitter (kind-a), this how it looks like now:
It's working, but is it correct? My piezo buzzer is 3-24V. I use the potentiometer as a volume control. The button is for ...
1
vote
2answers
99 views
are 3 connections necessary for a push button?
I'm referring to the 5th circuit (see below screenshot) of the sparkfun manual came with the arduino uno. Instead of connecting all three of the (+) (-) and the digital pin to each push button, can I ...
2
votes
1answer
62 views
Noob coding - don't know what's going wrong - controlling relays with IR and button
I'm new to the forum, electronics and coding...so pretty green really but really enjoying messing around with the arduino so far and I think I'm picking up some skills just by messing around.
I ...
3
votes
1answer
128 views
sending ctrl-z in a struct?
I have a set of buttons wired to an arduino leonardo that are meant to send either single keystrokes to a computer "a, b, c..." etc, or a key sequence like ctrl+z (to perform an undo command.) ...