Advertisement
NightFlash

Reset Arduino

Jan 17th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. /*
  2.   Blink
  3.   Turns on an LED on for one second, then off for one second, repeatedly.
  4.  
  5.   This example code is in the public domain.
  6.  */
  7.  
  8. // Pin 13 has an LED connected on most Arduino boards.
  9. // give it a name:
  10. int led = 13;
  11.  
  12. void(* resetFunc) (void) = 0;
  13.  
  14. // the setup routine runs once when you press reset:
  15. void setup() {                
  16.   // initialize the digital pin as an output.
  17.   pinMode(led, OUTPUT);    
  18. }
  19.  
  20. // the loop routine runs over and over again forever:
  21. void loop() {
  22.   digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  23.   delay(1000);               // wait for a second
  24.   digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  25.   delay(1000);               // wait for a second
  26.  
  27.   resetFunc();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement