double result; double volt; char Ausgabe[1]; unsigned int i = 0; unsigned char t_high = 0; unsigned char t_low = 0; unsigned int timer=0; float rpm=0; unsigned int zwischen_erg; unsigned char g_temp[40]; unsigned char sreg; unsigned char g_overflow=0; // Anzahl der Überläufe aus dem Interrupt unsigned char g_ticks=0; SIGNAL (SIG_INPUT_CAPTURE1){ g_ticks = g_overflow; t_low = ICR1L; t_high = ICR1H; TCNT1H = 0; TCNT1L = 0; ICR1H = 0; ICR1L = 0; } SIGNAL (SIG_OVERFLOW1){ g_overflow++; } int main(void) { DDRD = 0x00; //Eingang DDRC = 0xF8; DDRB = 0xFF; DDRA = 0x00; PORTA = 0x00; lcd_init(LCD_DISP_ON); //SREG |= (1<<7); //Global Interrupt Enable sei(); ACSR |= (1<1000){ lcd_clrscr(); lcd_gotoxy(0,0); sprintf(g_temp,"Tim: %6u",timer); lcd_puts(g_temp); sprintf(g_temp," RPM %d", rpm); // zwischen_erg anstatt rpm lcd_puts(g_temp); lcd_gotoxy(0,1); sprintf(g_temp,"high: %d low %d",t_high,t_low); lcd_puts(g_temp); sprintf(g_temp," over %d",g_ticks); lcd_puts(g_temp); i = 0; } //SREG = sreg; } };