I have recently made a lightning trigger, added the code to my Uno and got it working on my 400D, however, after testing it, I tried it with my 7D and it doesn't work, I checked the cable connections and they work correctly, could it be the optocoupler I used ( 4N35) or something in the code. I am very new at this and don't really know how to write the code. The other problem is how can I send a signal to keep the camera awake between lightning strikes.
The code I have used is
// Lightning Catcher for Arduino
// Written by Uria Dubinsky
// www.udpic.co.il
#define poten A5 // Potentiometer Analog pin no. 5, for setting sensetivity
#define seLight A0 // Light Sensor Analog pin no. 0
#define shoot 10 // Optisolator Digital pin no. 10 for making the shoot
int ambient =0; // integer for the ambient light avrage keeping
int sensitiv, lastSens; // sensitiv integer for keeping the sensetivity levels value, lastSens integer for keeping the last light metring value
void setup () {
Serial.begin (9600);
pinMode (poten, INPUT); // Setting the pins modes
pinMode (seLight, INPUT);
pinMode (shoot, OUTPUT);
digitalWrite (shoot, LOW); // Making sure the shoot pin is LOW
ambient = analogRead (seLight); // insert a first ambient value
}
void loop () {
lastSens = analogRead (seLight); // Analog reading the light sensor
if (isSpike (lastSens) == false) { // Compering the ambient value for a spike in the light (through the isSpike function)
ambient = ((ambient + lastSens) / 2); // If there is no spike enters the value to the ambient avrage
}
else {
digitalWrite (shoot, HIGH); // If there is a spike in the light making the shoot
delay (20);
digitalWrite (shoot, LOW);
}
}
boolean isSpike (int sensRead) { // Function recive the value of the last light mesuring and return true for a spike and false for non
sensitiv = analogRead (poten);
if (sensRead <= ambient+sensitiv ) return false; else return true;
}
Thank you