This repository has been archived on 2022-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
speedclock/Arduino_Libs/TimerOne-master/examples/ATTiny85/ATTiny85.ino

20 lines
318 B
Arduino
Raw Normal View History

2018-07-17 22:47:25 +02:00
#include <TimerOne.h>
#define ledPin 4
int ledState = LOW;
void setup() {
pinMode(ledPin, OUTPUT);
Timer1.initialize(500000); //The led will blink in a half second time interval
Timer1.attachInterrupt(blinkLed);
}
void loop() {
}
void blinkLed(){
ledState = !ledState;
digitalWrite(ledPin, ledState);
}