Skip to content

Instantly share code, notes, and snippets.

@ibanezmatt13
Created July 9, 2015 20:17
Show Gist options
  • Save ibanezmatt13/4653c72e844079002d7e to your computer and use it in GitHub Desktop.
Save ibanezmatt13/4653c72e844079002d7e to your computer and use it in GitHub Desktop.
#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