Button Press timing/relay
hi guys,
thanks far! wasn't sure post question since solution may either coding or hardware, thought place...
is possible make single button press last desired amount of time? example, i'd single on/off button last 1 second within code. act relay in way activating relay cause turn on , off given time.
for example, simple led on/off controlled using button: press button, led turns on, let go of button, led turns off. of course tell led stay on 1 second when button pressed once i'm trying achieve, think need 'led' 'think' button has been held down longer.
so have like:
if (button == high);
=1000ms
1000ms = 'buttonheld'
then in void loop,
if (buttonheld == high)
'turnledon'
does make sense? language wrong i'm not sure about
many in advance,
kyle
thanks far! wasn't sure post question since solution may either coding or hardware, thought place...
is possible make single button press last desired amount of time? example, i'd single on/off button last 1 second within code. act relay in way activating relay cause turn on , off given time.
for example, simple led on/off controlled using button: press button, led turns on, let go of button, led turns off. of course tell led stay on 1 second when button pressed once i'm trying achieve, think need 'led' 'think' button has been held down longer.
so have like:
if (button == high);
=1000ms
1000ms = 'buttonheld'
then in void loop,
if (buttonheld == high)
'turnledon'
does make sense? language wrong i'm not sure about
many in advance,
kyle
sorry, meant post forum!
Arduino Forum > Using Arduino > Programming Questions > Button Press timing/relay
arduino
Comments
Post a Comment