/********************************************* Chip type : ATmega128 Program type : Application Clock frequency : 8.000000 MHz Memory model : Small Internal SRAM size : 4096 External SRAM size : 0 Data Stack size : 1024 *********************************************/ #include #include void main(void) { int i,j; DDRB=0xFF; PORTB=0x00; while (1) { // Place your code here for(i=1;i<=25;i++) { for(j=1;j<=8;j=j*2) { PORTB=~j; delay_ms(200); } } for(i=1;i<=25;i++) { for(j=8;j>=1;j=j/2) { PORTB=~j; delay_ms(200); } } }; }