#include "avr/io.h" #include "util/delay.h" #include "avr/interrupt.h" #include "stdio.h" #include "lcd.h" #include "rot.h" #define nop() asm volatile("nop") unsigned char rot_pos=0; int main() { lcd_init(); rot_init(); TCCR0 = (1<>1; //Neue Position berechnen char str[5]; if(tmp != 0) //Wenn sich was verändert hatte { snprintf(str,5,"%u",rot_pos); //Neue Position ausgeben lcd_loc(0); lcd_puts(" "); lcd_loc(0); lcd_puts(str); } } } SIGNAL(TIMER0_COMP_vect) //31,25 kHz @ FCLK = 16MHz { lcd_IRQ(); rot_IRQ(); }