elyasfy
10-23-2010, 11:57 AM
im using for my graduation project a keypad with 3 colum and 4 row
i already do the configration but i dont know how to set the pasword
for example when im using if statment
it accept password "12" and "21" and its not taking it digit by digit
this is my code
please help
keypad:
DO
HIGH 2
LOW 4
LOW 6
LOW 7
IF (IN3=1) THEN 'for row 1
a=1
DEBUG "1"
PAUSE 100
ELSEIF (IN1=1) THEN
a=2
DEBUG "2"
ELSEIF (IN5=1) THEN
a=3
DEBUG "3"
ENDIF
PAUSE 100
Raw2:
HIGH 7 ' for row 2
LOW 2
LOW 4
LOW 6
IF (IN3=1) THEN
a=4
DEBUG "4"
ELSEIF(IN1=1) THEN
a=5
DEBUG "5"
ELSEIF(IN5=1) THEN
a=6
DEBUG "6"
ENDIF
PAUSE 100
Raw3:
HIGH 6 'for row 3
LOW 4
LOW 7
LOW 4
IF (IN3=1) THEN
a=7
DEBUG "7"
ELSEIF(IN1=1) THEN
a=8
DEBUG "8"
ELSEIF (IN5=1) THEN
a=9
DEBUG "9"
ENDIF
PAUSE 100
Raw4:
HIGH 4
LOW 6
LOW 7
LOW 2
' for row 4
IF (IN3=1) THEN
a=$2A
DEBUG "*"
ELSEIF (IN1=1)THEN
a=0
DEBUG "0"
ELSEIF(IN5=1) THEN
a=$23
DEBUG "#"
GOTO confirm
ENDIF
PAUSE 100
LOOP
confirm :
IF (a=1) THEN
GOTO second
ENDIF
second:
IF (a=2) THEN
GOTO correct
ELSE
GOTO show
ENDIF
correct:
DEBUG "Door Open"
PAUSE 2000
GOTO main ' the right password
show :
DEBUG "wrong password"
PAUSE 2000
i already do the configration but i dont know how to set the pasword
for example when im using if statment
it accept password "12" and "21" and its not taking it digit by digit
this is my code
please help
keypad:
DO
HIGH 2
LOW 4
LOW 6
LOW 7
IF (IN3=1) THEN 'for row 1
a=1
DEBUG "1"
PAUSE 100
ELSEIF (IN1=1) THEN
a=2
DEBUG "2"
ELSEIF (IN5=1) THEN
a=3
DEBUG "3"
ENDIF
PAUSE 100
Raw2:
HIGH 7 ' for row 2
LOW 2
LOW 4
LOW 6
IF (IN3=1) THEN
a=4
DEBUG "4"
ELSEIF(IN1=1) THEN
a=5
DEBUG "5"
ELSEIF(IN5=1) THEN
a=6
DEBUG "6"
ENDIF
PAUSE 100
Raw3:
HIGH 6 'for row 3
LOW 4
LOW 7
LOW 4
IF (IN3=1) THEN
a=7
DEBUG "7"
ELSEIF(IN1=1) THEN
a=8
DEBUG "8"
ELSEIF (IN5=1) THEN
a=9
DEBUG "9"
ENDIF
PAUSE 100
Raw4:
HIGH 4
LOW 6
LOW 7
LOW 2
' for row 4
IF (IN3=1) THEN
a=$2A
DEBUG "*"
ELSEIF (IN1=1)THEN
a=0
DEBUG "0"
ELSEIF(IN5=1) THEN
a=$23
DEBUG "#"
GOTO confirm
ENDIF
PAUSE 100
LOOP
confirm :
IF (a=1) THEN
GOTO second
ENDIF
second:
IF (a=2) THEN
GOTO correct
ELSE
GOTO show
ENDIF
correct:
DEBUG "Door Open"
PAUSE 2000
GOTO main ' the right password
show :
DEBUG "wrong password"
PAUSE 2000