Page 734 - 2
P. 734

{
                unsigned char keyscanvalue;
                    keyscanvalue = keysort();                      //keysort  함수에서 받아온 값을 변수에 저장
                lcd_clear();                                       // 키매트릭스 입력이 LCD       에 표시되도록 함
                lcd_gotoxy(0,0);
                lcd_puts("Enter Password");


                lcd_gotoxy(0,1);
                sprintf(sbuf,"[%x%x%x%x%x]",input[1],input[2],input[3],input[4],input[5]);
                lcd_puts(sbuf);


                if(keyscanvalue < 12)                                          // 값을 받아올 때마다 LCD         갱신
                {
                    input[j] = keyscanvalue;
                    intech_delay_ms(250);
                    j++;
                    lcd_clear();
                    lcd_gotoxy(0,0);
                    lcd_puts("Enter Password");


                    lcd_gotoxy(0,1);
                    sprintf(sbuf,"[%x%x%x%x%x]",input[1],input[2],input[3],input[4],input[5]);
                    lcd_puts(sbuf);
                    if(keyscanvalue == 11)                                               // 완료키를 눌렀을 때
                    {
                        for(k = 0; k < 6; k++)                                          // 비밀번호를 비교한다.
                        {
                            if(input[k] == comp[k])
                            {
                                correct[k] = 1;
                            }
                        }
                        if(correct[1] == 1 & correct[2] == 1 & correct[3] == 1 & correct[4] == 1 & corre
            ct[5] == 1) // 설정된 비밀번호와 일치한다면
                        {
                            lcd_clear();                                         // 맞는 비밀번호임을 출력한 뒤
                            lcd_gotoxy(0,0);
                            lcd_puts("Right Password");
                            intech_delay_ms(2000);
                            for(j = 0; j < 6; j++)                            // 입력된 비밀번호를 초기화 하고
                                {
                                input[j] = 0;
                                correct[j] = 0;
                                }
                            j = 1;                                                          //j 를 초기화한 뒤


                                                         - 734 -
   729   730   731   732   733   734   735   736   737   738   739