' {$STAMP BS2} ' {$PBASIC 2.5} Password DATA "1011" ' Store "secret" password here. index VAR Nib ' Index variable. temp VAR Byte ' Stores single char. userEntry VAR Byte(4) ' Store user entered password. DO DEBUG "Enter password: " ' User instructions DEBUGIN STR userEntry \4 ' Get user input password. FOR index = 0 TO 3 ' Check array against DATA READ Password + index, temp ' Get next password char IF temp <> userEntry(index) THEN EXIT ' Compare to user input, NEXT ' exit if not equal. IF index <> 4 THEN ' If exit, then index not equal DEBUG CR,"Password not correct.", CR ' to 5 and pass is not correct. DO FREQOUT 5, 500, 3000 'Alarm is now ON PAUSE 100 FREQOUT 5, 500, 3000 LOOP ENDIF LOOP UNTIL index = 4 ' Only get out of loop when ' index = 5. DEBUG CR, "Password is correct;", CR, ' Program can move on when "program can continue..." ' password is correct. HIGH 13 ' Light ON for 5 sec PAUSE 5000 LOW 13 ' Then off PULSOUT 15, 850 ' "Door opens" END ' The only thing I need to find is how to input 1 and 0 to the Debug Terminal's Transmit Windowpane ' I will use pushbuttons to do that. ' Which commands can be useful to make that possible ' If it is not possible can you tell me how do do it or how to correct my program. ' Thank you