Gast
#806220
Hallo, ich habe ne ganz simple Frage zu meinen kleinen Programm das einfach eine LED einschalten soll solange ich auf einen Taster drücke. dieses Programm funktioniert, aber sobald ich den Befehl PORTC = 0x01; durch PORTC |= (1 << 1); ersetze tut sich nichts mehr. bool alarm = false; int main() { DDRC = 0xFF; // PC0..PC7 as output PORTC = 0x00; // all PORTC output pins Off DDRA = 0x00; //all A port pins as input PORTA=(1<<PA0); //Enable internal Pull-Up resistors while(1) { if (bit_is_clear(PINA,PA0)) alarm=true; if (alarm == true) { // Alarmfall // PORTC |= (1 << 1); PORTC = 0x01; alarm = false; } else PORTC = 0x00; } return 0; } Weis jemand warum? Was mache ich falsch?