Professional Documents
Culture Documents
Shutter Test
Shutter Test
Shutter Test
if(Risingflag ==1){
Start = micros(); //set the variable Start to current microseconds
Risingflag=0; //reset the rising flag to 0, so that this function isnt
called again until the shutter actually fires
}
if(Fallingflag == 1){
Stop = micros(); // set the variable Stop to current microseconds
Fallingflag = 0; //reset the falling flag to 0, so that this function isnt
called again untill the shutter fires again.
Fired = 1; // set the fired flag to 1, triggering the calculation of a
shutter speed, and its display over the serial monitor.
}
if(Fired == 1){ //if the flag Fired = 1, print this
information to the serial monitor"
Serial.print("Start: ");
Serial.println(Start);
Serial.print("Stop: ");
Serial.println(Stop);
long Speed = (Stop - Start); // make a variable called speed, which is the
total number of microseconds that the shutter is open for
Serial.print("Microseconds: ");
Serial.println(Speed); //display total microseconds in shutter
interval