Guest User

Untitled

a guest
Apr 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <TimerThree.h>
  2.  
  3. TimerThree t1;
  4.  
  5. void setup(){
  6.    
  7.     Serial.println("Timer test @ 1 second");
  8.     Serial.begin(9600);
  9.     t1.initialize(2000000);
  10.     t1.attachInterrupt(callback);
  11.    
  12. }
  13.  
  14. void callback(){
  15.   printstuff();
  16. }
  17.  
  18. void loop(){
  19.   Serial.print("one second delay loop");
  20.   delay(1000);
  21. }
  22.  
  23. void printstuff(){
  24.   Serial.print("timer interrupt triggered ");
  25. }
Add Comment
Please, Sign In to add comment