Monday, February 5, 2007
Wiggle, wiggle.
Our team created a diagram to help instruct us and maybe others to use this small network. Posted is a lower resolution version but we have made a hi-res pdf as well. Our system definitely worked, but only yielded a slight movement. One suggestion has been to get stronger piano wire and to make the system tighter at rest, so that it will move more.
Here is our code:
' ONOFF
'{$STAMP BS2}
'{$PBASIC 2.5}
DO
HIGH 1
PAUSE 3000
LOW 1
PAUSE 3000
LOOP
-------------
' SENSOR
' {$STAMP BS2}
' {$PBASIC 2.5}
PIR PIN 0 ' this is the P# port that your PIR is wired to
counter VAR Byte ' Trip Counter
Main:
DO
IF PIR = 1 THEN ' Motion Detected?
counter = counter + 1 ' Update Trip Counter
HIGH 1 ' send power to flexinol
DEBUG HOME, "TRIPPED...", DEC3 counter
DO : LOOP UNTIL PIR = 0 ' Wait For PIR To Clear
DEBUG HOME, "CLEARED...", DEC3 counter
LOW 1 ' Turn Off flexinol
ENDIF
LOOP

