Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "TimerOne.h"
- void setup()
- {
- pinMode(13, OUTPUT);
- Timer1.initialize(500000); // initialize timer1, and set a 1/2 second period
- Timer1.attachInterrupt(callback); // attaches callback() as a timer overflow interrupt
- }
- //--------------------------------------
- void callback()
- {
- digitalWrite(13, digitalRead(13) ^ 1);
- }
- //--------------------------------------
- void loop()
- {
- // your program here...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement