How do we add pushbuttons to create a password?
I'm looking now how to add pushbuttons into my circuit.
Please look at the attachment below to see what exacty I want to do.
password microcontroller.txt
Is there any solution to make my project work.
I got my microcontroller only 3 weeks ago, so I'm new in basic stamps.
Can you help me?

Please look at the attachment below to see what exacty I want to do.
password microcontroller.txt
Is there any solution to make my project work.
I got my microcontroller only 3 weeks ago, so I'm new in basic stamps.
Can you help me?
Comments
Can you show me an example.
The book was unclear about this command.
How do we use SERIN to make a password with pushbuttons.
Here's a SERIN example straight out of the Basic Stamp Manual that waits for an exact string match.
SERIN 1, 16468, [WAIT("SESAME")] DEBUG "Password accepted."
For push buttons, you would read the state of IO pins. The button must be wire properly, also in the manual.
IF INA = %1101 THEN 'Do something END IF
Try the exercises in "What's a Microcontroller" found in the Help drop down of the PBasic Editor. This will give you the experience to complete your project.
' {$STAMP BS2} ' {$PBASIC 2.5} counter VAR Word ' Counter Variable 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, IF INA = %1101 THEN Open_Door ' Goto label Open_Door when buttons match ' for PINS 0 - 4 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 ' Alarm is ON FREQOUT 5, 500, 3000 ' Creation of a beeping sound HIGH 13 ' Flashing LEDs LOW 12 PAUSE 100 FREQOUT 5, 500, 3000 HIGH 12 LOW 13 LOOP ENDIF LOOP UNTIL index = 4 ' Only get out of loop when ' index = 5. Open_Door: ' Open the Sliding Door DEBUG CR, "Password is correct;", CR, ' Program can move on when "program can continue..." ' password is correct. HIGH 13 FOR counter = 1 TO 150 ' "Door Opens" (Sliding door) PULSOUT 14, 1200 PAUSE 20 NEXT ' Light ON for 5 sec PAUSE 5000 LOW 13 ' Then off FOR counter = 1 TO 150 ' "Door closes" (Sliding door) PULSOUT 14, 300 PAUSE 20 NEXT END
BTW, I posted your code for you so everyone can see what you did so far and it makes it easy for someone to help you better.' PROJECT PASSWORD ' IF PASSWORD CORRECT ' - sliding door will open ' - Light will turn ON for 5 seconds ' IF PASSWORD INCORRECT, ALARM WILL TURN ON, ' - LEDs will be flashing, ' - A beeping sound from a piezo speaker will be heard. ' What I want to add ' I want to add pushbuttons to start the password. ' I'm not sure if this will work, but is it possible to write into the Transmit Windowpane? ' I only need to know which commands I need to write to do that ' If not is there any other solution to make my project happen? ' THIS IS WHAT I GOT until now without the pushbuttons ' {$STAMP BS2} ' {$PBASIC 2.5} counter VAR Word ' Counter Variable 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 ' Alarm is ON FREQOUT 5, 500, 3000 ' Creation of a beeping sound HIGH 13 ' Flashing LEDs LOW 12 PAUSE 100 FREQOUT 5, 500, 3000 HIGH 12 LOW 13 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 FOR counter = 1 TO 150 ' "Door Opens" (Sliding door) PULSOUT 14, 1200 PAUSE 20 NEXT ' Light ON for 5 sec PAUSE 5000 LOW 13 ' Then off FOR counter = 1 TO 150 ' "Door closes" (Sliding door) PULSOUT 14, 300 PAUSE 20 NEXT END ' THANK YOU
Mike and William.
You helped me a lot.