#include #include #include #ifndef OCR1A #define OCR1A OCR1 #endif #ifndef WGM12 #define WGM12 CTC1 #endif #ifndef PINC #define KEY_INPUT PIND #else #define KEY_INPUT PINC #endif #define LED_DIR DDRB #define XTAL 11059008L #define DEBOUNCE 256L #define uchar unsigned char #define uint unsigned int uchar prescaler; uchar volatile second; SIGNAL (SIG_OUTPUT_COMPARE1A) { #if XTAL % DEBOUNCE OCR1A = XTAL / DEBOUNCE - 1; #endif if( --prescaler == 0 ){ prescaler = (uchar)DEBOUNCE; second++; #if XTAL % DEBOUNCE OCR1A = XTAL / DEBOUNCE + XTAL % DEBOUNCE - 1; #endif } } int main( void ) { DDRD |= (1 << PD0); // PD0 als Ausgang festlegen// int sek = 0; while(1) TCCR1B = (1<