Created
July 9, 2015 20:17
-
-
Save ibanezmatt13/4653c72e844079002d7e 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> | |
int main(void){ | |
unsigned int PIN = 5; | |
TCCR1B |= ((1 << CS10) | (1 << CS12)); | |
DDRB |= (1 << PIN); // enable LED pin in DDRB register | |
for (;;){ | |
if (TCNT1 >= 7812){ | |
PORTB ^= (1 << PIN); | |
TCNT1 = 0; | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment