Page 258 - MDP2020-3
P. 258
252
| 인천전자마이스터고등학교 ·············································································································
PORTE = 0x00;
PORTB = 0x00;
PORTC = 0x00;
PORTD = 0xFF;
while (1)
{
if (PINE.0 == 0) {
Step1(step);
}
else if (PINE.1 == 0) {
Step2(step);
}
else if (PINE.2 == 0) {
Step3(step);
}
else if (PINE.3 == 0) {
Step4(step);
}
lcd_gotoxy(0,0);
if(b==0){
lcd_puts("SECRET:");
PORTD = 0xf0; //키 매트릭스 초기값 설정
if((PIND&0xf0)!=0xf0){
Key();
PORTD = 0xf0; //키 매트릭스
while(PIND != 0xf0); //스위치가 눌렸을 때만 작동하게 설정
delay_ms(1);
}
}
if (b==1){
if(cnt==5){
comparePW();
if(count==4) rightPW();
else wrongPW();
}
else {