Author Topic: Make arduino enter Void loop() only after a button is pressed, possible?  (Read 1256 times)

0 Members and 1 Guest are viewing this topic.

Offline MrOmnosTopic starter

  • Frequent Contributor
  • **
  • Posts: 260
  • Country: np
  • BE in Electronics and Communication
I want my arduino to go into void loop only after a button is pressed. Like a start button. How do I do that?
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Make arduino enter Void loop() only after a button is pressed, possible?
« Reply #1 on: December 17, 2015, 06:03:38 pm »
The Arduino IDE automatically adds a main() function that closely resembles:
Code: [Select]
int main(void)
{
    init();
    setup();
    for (;;) {
        loop();
    }
    return 0;
}
So, simply wait for the button at the end of void setup().
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf