case 2:
outp(PORTB, 0x20);
printf("Push Button 2 (SW2( is onn");
count = 0;
do
{
i = ((0xff - inp(PORTC)) >> 4) & 0x02;
if(i = 0) count++;
delay(1);
}
while(count < 10);
count = 0;
do
{
i=((0xff - inp(PORTC)) >> 4) & 0x02;
if(i==0) count++;
delay(1);
}
while(count < 10);
outp(PORTB, 0x00);
break;
저건 케이스2고 케이스 1,2,4,8 이렇게 4개가 있고 각각 LED1,2,3,4랑 연결 되어있어서 버튼 하나에 LED하나가 켜짐.
근데 내가 원하는건 버튼 4개를 동시에 눌렀을 때 LED도 4개 동시에 들어오는거.
outp(PORTB, 0x20);
printf("Push Button 2 (SW2( is onn");
count = 0;
do
{
i = ((0xff - inp(PORTC)) >> 4) & 0x02;
if(i = 0) count++;
delay(1);
}
while(count < 10);
count = 0;
do
{
i=((0xff - inp(PORTC)) >> 4) & 0x02;
if(i==0) count++;
delay(1);
}
while(count < 10);
outp(PORTB, 0x00);
break;
저건 케이스2고 케이스 1,2,4,8 이렇게 4개가 있고 각각 LED1,2,3,4랑 연결 되어있어서 버튼 하나에 LED하나가 켜짐.
근데 내가 원하는건 버튼 4개를 동시에 눌렀을 때 LED도 4개 동시에 들어오는거.
댓글 0