I just bought a Mega 2560 a week ago and am very new to programming and the arduino code. I have 1 input (button) that once pressed, starts 3 outputs. I am trying to program my board to be able to press one button that then, turns two 12v dc motors on for 1 minute, and at the same time turns a 12v solenoid valve on for 3 seconds every 15 seconds (inside 1 minute). The 3 outputs operate within a minute. My motors and solenoid are connected from a pwm pin on the board to a transistor which switches them on and off. Im just trying to figure out how to program 1 input to set off 3 outputs. I have been staring at code and trying to figure this out for the past week but I cannot find a simple solution. I have several programs wrote but I cant figure out how to get it all to work together. Any sort of help would be greatly appreciated!
So basically:
1.) board is looking for button to be pressed
2.)once pressed 2 12v dc motors start
3.) a 12v solenoid valve turns on for 3 seconds
4.)solenoid turns off for 15 seconds (motors still running)
5.)solenoid turns on for 3 seconds (motors still running)
6.)solenoid turns off for 15 seconds (motors still running)
7.)solenoid turns on for 3 seconds (motors still running)
8.)solenoid turns off for 15seconds (motors still running)
9.)solenoid turns on for 3 seconds (motors still running) (at this point the program is running for 57 seconds)
10.)solenoid turns off for 3 seconds (motor still running) (I say its off for "3" seconds because after 3 seconds the loop is over)
11.)Once 1 minute is reached the dc motors and solenoid are stopped.
12.)the board is looking for button to be pressed
13.) .....etc.