I am currently working on swapping over all of my Halloween props from PLC to PICAXE controlled. I have received some help from fellow Haunters on basic setting up and modify as needed but came across my Electric Chair prop and ran into a small problem. During the triggering of the code, I have a section that controls a solenoid valve which moves the prop back and forth in the chair. So my question is, can a "random" command be used to control the output while the "shake" output is HIGH. What I am looking for is a very rapid/violent (on/off) simulation during the shocking stage of the run.
Dave
Dave
Code:
#Picaxe 14M2
'b.0 = strobes
'b.1 = screams
'b.2 = shake
'b.3 = smoke
'b.4 = shock
'c.3 = PIR
symbol strobes = b.0
symbol screams = b.1
symbol shake = b.2
symbol smoke = b.3
symbol shock = b.4
symbol PIR_IN = pinC.3
symbol PIR_COUNT=b5
start:
wait 20 'delay to allow PIR to settle
standby:
Do : Loop Until PIR_IN=1
Do
PIR_COUNT = PIR_COUNT + 1 * PIR_IN
Loop Until PIR_COUNT = 2
PIR_COUNT = 0
goto activate
activate:
high strobes
wait 2
high screams
wait 2
high shake
wait 5
high smoke
wait 1
high shock
wait 6
low screams
low shake
wait 3
low smoke
low shock
wait 2
low strobes
wait 10
goto standby