반응형

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

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






"Download" Proteus File - [Proteus] - Key_LED_Blink.zip

"Download" Source Code -  [Codevision] - Key_LED_Blink.zip




<Proteus Circuit>





<Source Code>


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

void main(void)
{
    DDRC.0 = 0;
    PORTC.0 = 1;    // Use Internal Pull-up

    DDRD = 0xFF;
    
    while (1)
    {   
        if(!PINC.0)
        {         
            PORTD ^= 0xFF;
            
            while(!PINC.0);

            delay_ms(50); 
        }                
    }
}


반응형
Posted by 메가아재
,