For a password, I'd use logic like this:
(Every key pressed sends "#" so that someone looking over your shoulder can't see what you entered.)
password is a an array that you setup and holds the password value
for i = 0 to 3 'for 4 digit password
read keys
if no key, re-read keys
if key pressed <> password[i] then fail = 1
send LCD "#", no CR of LF
next i
if fail = 0 then go forward, else LCD "FAIL" (or something), clear LCD, fail = 0 and go back to password loop
This only the logic flow, not verbatim code.
Last edited by JD123; - 22nd March 2008 at 16:29.
No, I'm not Superman, but I did stay at a Holiday Inn Express last night!
Bookmarks