Monday, April 23, 2018

Reset Arduino by Code

The code on below shows how to initialize the reset function for arduino code and use it while coding.I had reset the arduino after 5000ms delay.

void(* resetFunc) (void) = 0; //initialize the reset function  

void setup() {   
// put your setup code here, to run once:
  }  

void loop() {   
// put your main code here, to run repeatedly:   
delay(5000);   
resetFunc();  //you can call this method to reset your arduino  
  }  

No comments:

Post a Comment