Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- running light timer1 234 ms
- */
- #define F_CPU 7372800UL
- #include <avr/io.h>
- #include <avr/interrupt.h>
- ISR(TIMER1_COMPA_vect){
- if(PORTA == 0x00){
- PORTA = 0xff;
- }
- PORTA = PORTA << 1;
- }
- int main(void)
- {
- DDRA = 0xff;
- PORTA = 0xff;
- TCCR1A = (1 << COM1A1) | (1 << COM1A0);
- TCCR1B = (1 << WGM12) | (1 << CS12);
- TIMSK = (1 << OCIE1A);
- OCR1A = 3372;
- sei();
- while (1)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement