I literally just started yesterday on learning the arduino language but i know a good amount of css and javascript so i understand how the format works and i kinda get how to do things on the arduino. the one thing I'm trying to do is set an input command on a button that starts a void loop when pressed. kind of like an ignition button on some cars. what i have setup is:
what i need to figure out is how to start void loop with int button command which i have had no luck tinkering with the lines. any help will be most appreciated!
You need another loop. I'd probably use a while() loop. Run a "do nothing" while loop and break-out of the loop and continue when the button is pushed.
the loop is always running
however you can go to a function
put this in loop
IF (button=HIGH){dosomething()}
below loop
void dosomething()
{digitalWrite(led,high)
}
shooter:
the loop is always running
however you can go to a function
put this in loop
IF (button=HIGH){dosomething()}
below loop
void dosomething()
{digitalWrite(led,high)
}