stormbytes

Untitled

Jan 1st, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. void setup() {
  2.   pinMode(10, INPUT_PULLUP);
  3. }
  4.  
  5. void loop() {
  6.   int btn_state = digitalRead(10);
  7.  
  8.   if(btn_state == LOW){
  9.      SystemReset();
  10.   }
  11.  
  12. }
  13.  
  14. void(* resetFunc) (void) = 0; //declare reset function at address 0
  15.  
  16. void SystemReset() {
  17.   resetFunc();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment