Hello, I've just purchased an Arduino Duemilanove about a week ago to control a Halloween prop I'm making and I'm no programmer! I've been reading the sections; getting started, playground, tutorials and such but I'm just not getting it fast enough so now I'm getting nervous. I can write down what I want to do in English. Would someone be willing to look at my statement and please help me program it? I need to test it all out before Halloween so I'm feeling really rushed. Thank you.
/*
2011
Control of a Halloween Graveyard through a 8-Relay card.
Arduino Duemilanove for controller
Relay card here: http://arduino-direct.com/sunshop/index.php?l=product_detail&p=156
SENSOR-1
An IR Barrier Switch is the sensor. When activated it provides 9VDC to a buzzer.
I have removed the buzzer and installed a LM7805CT to bring the 9VDC down
to 5VDC to act as an input the Arduino can handle.
AUDIO-1,2,3,4
Sound card has 4 push buttons for 4 sounds so a CLOSED relay would = on
AIR VLV-1,2
Two 24VAC solonoid valves will activate two pneumatic props, so a CLOSED
relay would allow a power on condition and air to flow.
LIGHTS-1
An electric prop, 9VDC series of lights, needs an on, so a CLOSED relay would = on
*/
SETUP
// turn everything off but the background noises
RELAY-1 = ON //AUDIO 1 = AMBIENT SOUND, needs to be able to loop when nothing else runs
RELAY-2 = OFF //AUDIO 2 = SCREAM
RELAY-3 = OFF //AIR VLV 1 = Prop-1
RELAY-4 = OFF //AUDIO 3 = LOUD MOAN
RELAY-5 = OFF //LIGHTS 1 = MINI LIGHTS
RELAY-6 = OFF //AIR VLV 2 = Prop-2
RELAY-7 = OFF //
RELAY-8 = OFF //
START
// is someone setting off the trap?
CHECK THE STATUS OF THE BEAM SENSOR
// spring the trap when a person walks by and start the effects
IF SENSOR-1 = ON THEN // beam sensor has activated
// Event 1
RELAY-1 = OFF // turn off background audio immediately
RELAY-2 = ON // want immediate Audio-2, it will auto off on it's own timer
RELAY-3 = ON // prop-1 activates
delay(5000) // keep prop-1 active for 5 seconds
// Pause and reset
RELAY-2 = OFF // turn it off for next go-round
RELAY-3 = OFF // deactivate prop-1 for next go-round
delay(2000) // spacer, pause for 2 seconds
// Event 2
RELAY-4 = ON // want Audio-3 to play, it will auto off on it's own timer
RELAY-5 = ON // set off lights-1
delay(5000) // keep Lights-1 active for 5 seconds
// Pause and reset
RELAY-4 = OFF // turn it off for next go-round
RELAY-5 = OFF // deactivate Lights for next go-round
delay(2000) // spacer, pause for 2 seconds
// Event 3
RELAY-4 = ON // want Audio-3 to play again, it will auto off on it's own timer
RELAY-6 = ON // prop-2 activates
delay(5000) // keep prop-2 active for 5 seconds
// Pause and reset
RELAY-4 = OFF // turn it off for next go-round
RELAY-6 = OFF // deactivate prop-2 for next go-round
delay(2000) // spacer, pause for 2 seconds
// Pause for effect, don't allow system to activate too fast after last run
delay(30000) // spacer, pause for 30 seconds
// what happens if no one walks by the sensor
IF SENSOR-1 = OFF THEN // beam sensor has not been tripped
// No Events keep background sounds running till SENSOR-1 is tripped
RELAY-1 = ON //AUDIO 1 = AMBIENT SOUND
RETURN TO START