Created
March 21, 2016 16:31
-
-
Save raghavendrahassy/65f4b4f0e13ce036b48c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<avr/io.h> | |
#define LED PD4 | |
int main() | |
{ | |
DDRD=0xff; //configure PORTD as output | |
OCR1AH = 0x3d; | |
OCR1AL = 0x09; | |
TCCR1B = (1<<CS10) | (1<<CS12); | |
while(1) | |
{ | |
while ((TIFR & 0x10) == 0); | |
TCNT1L = 0x00; | |
TCNT1H = 0x00; | |
TIFR=0x10; //clear timer1 overflow flag | |
PORTD ^= (0x01 << LED); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment