
[
click here for a printable version (PDF) of this page ]
PROP-1 101 :: Simple Push Button Trigger Test
This is the first in a line of tutorials from the GARAGE OF EVIL!! about using the PROP-1 to automate you haunt.
In this quick tutorial, we will show you how OXY CLEAN™ really does clean up all sorts of stains, including blood from your most recent murder victim!
First, soak the garment in a mixture of 95% water and 5% OXY CLEAN™...errr, wait, that's another tutorial for another day. In THIS tutorial, aside from
liberally taking the lords name in vain, we'll show an example of how to use a cheap $1.99 push button switch from Radio Shack
to trigger a prop, coffee maker, or, just to print a debug message back for that extra sense of satisfaction, without really doing a thing.
MATERIALS LIST
Ok, now that we've got that out of the way, onto assembly!

Hook up your connections like the photo above. Plug in the
power
to the
Prop-1, then the
serial cable, connect the serial cable to your
computer.
Fire up the
Parallax Basic Stamp Editor,
paste the following code in (below), and hook up your
3 Pin connector cable to the
switch
(the above picture only shows a 2 wire connection, this is because this is NOT the cable from EFX-TEK, however, one that I pulled from an old computer, which
had the same 3-pin terminal, which I had hacked off one end to, and soldered the connections to the two terminals on the switch. The only two wires that
need to connect to the prop-1 are to the W & R connections. Along the end of the row of the pins, you will see them labelled on the prop-1 as
W R B for
White,
Red, and
Black respectively, corresponding to the colors of the
3 Pin connector cable,
so you can discard the last cable.)
As mentioned in the rant between parenthesis above, hack off one end of the 3 Pin connector cable,
exposing the ends. Strip down the two wires (White and Red) to create leads, then solder those to the two terminals on the switch. (See horrible blurry photo below).

Now, upload the program to the PROP-1, and then press the switch. If you have it wired correctly, then you should see "SUCCESS! " written out to the debug window
each time it is pressed (or multiple times if you hold it down).

Click Here to Download the Code
'======================================================================
' File..... SPST Push-Button Switch Test 11.11.07.bs1
' Author... Geoff @ The GARAGE OF EVIL!!
' Web...... http://www.garageofevil.com
' {$STAMP BS1}
' {$PBASIC 1.0}
'
' -----[ Program Descripton ]------------------------------------------
' Using a Radio Shack SPST Switch Button (Part #275-011), connected via
' two wires (WR) on the Prop-1 to PIN0, when pressed, it completes the
' circuit, and then prints out "Success!" to the DEBUG window, letting
' you know that the button has been pressed.
'======================================================================
' -----[ Constants ]---------------------------------------------------
SYMBOL IsOn = 1
SYMBOL IsOff = 0
SYMBOL Trigger1 = PIN0
' -----[ Program Code ]------------------------------------------------
Main:
IF Trigger1 = IsOn THEN TestButton
GOTO Main
TestButton:
DEBUG "Success! "
GOTO Main
Click Here to Download the Code
This page was last modified on: November 11, 2007 08:50:11 pm