#include <avr/io.h>
#include <avr/delay.h>
int main(void)
{
// PortB initialisieren
DDRB = 0x20;// richtung input output
PORTB = 0x10; // 5V oder 0V
while(1)
{
if(PINB== 0x00) //wenn bei 12V strom abfließt alle pins B=0
{
PORTB = 0x30; // taste gedrückt PB4 und PB5 auf high gesetzt
}
else
{
PORTB = 0x10; // taste nicht gedrückt PB4 auf high
}
}
}