/************************************************/ /* */ /* C-Code Feuchtemesser Schaltung */ /* */ /***********************************************/ #include #include #include #include #include #define TAKT 1000000ul void blinken(void); int main(void) { //Initialisierung Port //DDRA = 0xFE; // b 1111.1110 DDRA |= 1<= 96) // rote LED { void blinken (void); PORTA = 0xFC; // b 1111.1100 } else if(ADC > 0x32 && ADC < 0x96) // gelbe LED /* 51 - 150 dezimal */ { void blinken (void); PORTA = 0xFA; // b 1111.1010 } else if(ADC <= 0x32) // grüne LED /* 50dezimal */ { void blinken (void); PORTA = 0xF6; // b 1111.0110 } } return 0; } void blinken(void) { while(1) { _delay_ms(250); PORTA |= (1 << PA1); _delay_ms(250); PORTA &= ~(1 << PA1); } }