본문 바로가기

프로테우스/스위치

스위치로 LED 제어


#include 
#include 

#define true 1

void main(void)
{
  char i=0xfe;
  DDRD=0xff;
  DDRB=0x00;
   
  while(1)
  {       
   if(PINB.0 == 1)
    PORTD=0xff;
    else
    PORTD=0x00;
   
   
  }
}

'프로테우스 > 스위치' 카테고리의 다른 글

스위치 2개로 LED 제어  (0) 2011.09.27