/***************************************************** Chip type : ATmega8 Program type : Application AVR Core Clock frequency: 1,000000 MHz Memory model : Small External RAM size : 0 Data Stack size : 256 *****************************************************/ #include #include void main() { PORTB=0xFF; DDRB=0x00; PORTD=0x00; DDRD=0xFF; while (1) { int i=0; int pole[4]={0b00001111,0b11110000,0b11001100,0b00110011}; PORTD=0; if(PINB.0 == 0) { for(i=0;i<4;i++) { PORTD=pole[i]; delay_ms(500); } } } }