Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void timerIsr() // interupt timernya
- {
- // Toggle LED
- second++;
- //Serial.print(second);
- if(second==60)
- {
- second=0;
- minute++;
- }
- if(minute==60)
- {
- minute=0;
- hour++;
- }
- if(hour==24)
- {
- hour=0;
- }
- }
- void setup(){
- Timer1.initialize(100000); // set a timer of length 100000 microseconds (or 0.1 sec - or 10Hz => the led will blink 5 times, 5 cycles of on-and-off, per second)
- Timer1.attachInterrupt( timerIsr ); // attach the service routine here
- ............
- ............
- }
- void loop()
- {
- sprintf(buf, "@twistedclever coba kirim tweet# %2d%02d%02d",hour,minute,second);
- sendTweet(buf);
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment