erstmal großes danke für die gute hilfe
=D>

allerdings habe ich nicht alles verstanden

ich habe es mal versucht zu berichtigen...

Code:
#include <avr/io.h>         
 
int main () {           
 
   DDRB  = 0x00;   // B Eingänge          
   
   DDRD  = 0xFF;   // D Ausgänge 
   PORTD = 0x11;   //Standard: D0,D4 gesetzt
   
   DDRA  = 0xFF;   // A Ausgänge      
   PORTA = 0x00; 
 
   while(1)
   {               
   
      if (!(PINB & (1<<PB1)) || !(PINB & (1<<PB2))) // Wenn B1 oder B2 == 0 dann ...
      {
         PORTD = 0x00;         // Alle D Ports auf 0
      }
 
      if ( PINB & (1<<PINB4) ) // Wenn B4 == 1 dann
      {
         PORTD = 0x17;         //D0,D1,D2,D4 gesetzt
      }

      if ( PINB & (1<<PINB3) ) // Wenn B3 == 1 dann
      {
         PORTD = 0x19;         //D0,D1,D4 gesetzt
      }
      
      if (!(PINB & (1<<PINB0)) ) // Wenn B0 == 0 dann
      {
         PORTD = 0x11;            //Standard: D0,D4 gesetzt
      }
   
      if((bit_is_set (PORTD,4)))      //2LEDs abwechselnd blinken
                              //Wenn PortD4 gesetzt
      {
         PORTD &= ~(1 << PD4);      //PortD4 auf 0 setzen PD4 statt nur 4
         PORTD |= (1 << PD5);         //PortD5 auf 1 setzen
      }
      else
      {
         PORTD &= ~(1 << PD5);      //PortD5 auf 0 setzen PD5 statt nur 5
         PORTD |= (1 << PD4);         //PortD4 auf 1 setzen
      }

   }               
   return 0;               
}