Essentially I want to fire off 3 (or more) flashes at the same time using the Uno...
This is going to be a somewhat lengthy post, but it includes the code, so please bear with it...
So I have this setup shown in the attached image and so far it works fine when I have 1 flash connected. The flash is connected to the jack that uses Pin 11 on the Uno. The 2 LEDs represent (and will soon be replaced by) solenoids to make water drops and take pics of them colliding. Everything works fine this way. I hit the button the relay causes the camera in Bulb mode to open shutter, valves open and close, flash fires and shutter closes.
Camera is a Canon 7D, flash is a Canon 580EX II.
Since I'm using very low power on the flash (manual mode - 1/128the of power) to get the shortest possible burst - the picture will not get much light, so I'm going to add more flashes, and I want to trigger them using connections to pins 12 and 13. Here is where I have a question about firing multiple flashes at the same time... I use this to fire off one and it works fine.
digitalWrite (flash1Pin, HIGH); //fire flash #1
delay (50);
digitalWrite (flash1Pin, LOW);
How would I get all 3 to go off at the same time? Would this simply do or will it require something more complicated? If so then what would you suggest?
digitalWrite (flash1Pin, HIGH); //fire flash #1
digitalWrite (flash2Pin, HIGH); //fire flash #2
digitalWrite (flash3Pin, HIGH); //fire flash #3
delay (50);
digitalWrite (flash1Pin, LOW);
digitalWrite (flash2Pin, LOW);
digitalWrite (flash3Pin, LOW);
I have only 1 flash right now to test with, which is not helping me and unless I can get 3 to definitely fire at the same time - I don't want to spend the $ on 2 more...
Here is the complete code:
const int button1Pin = 2; // pushbutton 1 pin
const int valve1Pin = 9; //solenoid valve one
const int valve2Pin = 10; //solenoid valve two pin
const int flash1Pin = 11; //flash #1 trigger pin
const int flash2Pin = 12; //flash #2 trigger pin
const int flash3Pin = 13; //flash #3 trigger pin
const int relayPin = 3; // use this pin to drive the transistor
void setup()
{
// Set up the pushbutton pins to be an input:
pinMode(button1Pin, INPUT);
pinMode(relayPin, OUTPUT); // set pin as an output
// Set up the LED pin to be an output:
pinMode (camerafocusPin, OUTPUT);
pinMode (camerashutterPin, OUTPUT);
pinMode (valve1Pin, OUTPUT);
pinMode (valve2Pin, OUTPUT);
pinMode (flash1Pin, OUTPUT);
pinMode (flash2Pin, OUTPUT);
pinMode (flash3Pin, OUTPUT);
}
void loop()
{
int button1State; // variable to hold the pushbutton states
button1State = digitalRead(button1Pin);
if (button1State == LOW) // if we're pushing button 1
{
digitalWrite(relayPin, LOW); // turn the relay OFF, this is what works for the camera shutter to turn on. Seems backwards but it works.
delay(1000); // wait for one second
digitalWrite (valve1Pin, HIGH); //open the first solenoid valve for 100 miliseconds
delay (100);
digitalWrite (valve1Pin, LOW);
delay (300); //delay between two valves
digitalWrite (valve2Pin, HIGH); //open the second solenoid valve for 150 miliseconds
delay (150);
digitalWrite (valve2Pin, LOW);
delay (200); // delay between the valve closing and drops actually hitting the water
digitalWrite (flash1Pin, HIGH); //fire flash #1
digitalWrite (flash2Pin, HIGH); //fire flash #1
digitalWrite (flash3Pin, HIGH); //fire flash #1
delay (50);
digitalWrite (flash1Pin, LOW);
digitalWrite (flash2Pin, LOW);
digitalWrite (flash3Pin, LOW);
delay (300);
digitalWrite(relayPin, HIGH); // turn the relay ON and close the camera shutter
}
else
{
digitalWrite(relayPin, HIGH); // turn the relay ON so the shutter stays closed
}
}
