반응형

- 시뮬레이터 -> 프로테우스 8.1 VSM

- 컴파일러 -> 코드비전 2.05



 

 

 

"Download" Proteus File - [Proteus] - LED Shift.zip

"Download" Source Code - [Codevision] - LED Shift.zip



<Proteus Circuit>





<Source Code>


#include <mega8.h>
#include <delay.h>

void main(void)
{
    unsigned char LED;

    DDRD = 0xFF;
    LED = 0x01;
  
    while (1)
    { 
        PORTD = LED; 
        delay_ms(1000);       
      
        if(LED >= 0x80)     LED = 0x01;
        else                LED <<= 1;
    }
}


반응형
Posted by 메가아재
,