laser trip line code help needed
Cordcole
Posts: 16
i have a basic stamp homework, for a Halloween project i need to have a laser beam hit the photo cell and trigger a relay for 3 seconds. the pins i use are not a concern. could i have help with some code
cheers
cheers
Comments
The hardest part is mounting the laser and ptx firmly so they stay in alignment. Even the Shack has a good $2 ptx: http://www.radioshack.com/product/index.jsp?productId=2049724
You can do a simple voltage divider with a series 1 meg resistor, feed that into a stamp and check for a high-low transistion when the beam is broken.
Piece of pie.
high (pin number)
pause 3000
goto start
time var word
do
high 2
pause 100
rctime 2, 1, time
IF (time>2000) THEN
HIGH 10
PAUSE 3000
LOW 10
PAUSE 1
ELSE
PAUSE 1
ENDIF
LOOP
Not sure what you're trying to accomplish with that else/pause 1.
A quicker way to get to Carnegie Hall:
a:
high 2
pause 1
rctime 2, 1, w0
IF w0<2000 THEN a
HIGH 10
PAUSE 3000
LOW 10
goto a