Project Description
Main Project Image
The project owner hasn't added main project image yet.
Project description
#Code Example for Arduino Uno
const int shutter = 12; // the number of the Shutter pin
const int focus = 13; // the number of the Focus pin
// Variables will change:
long previousMillis = 0; // will store last time Shutter was updated
// the follow variables is a long because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long interval = 5000; // interval at which to fire shutter (milliseconds)
long focusDelay = 2000; // interval between focus and shutter
boolean focusBool = true; // wether the camera should focus between intervals
void setup() {
pinMode(shutter, OUTPUT);
pinMode(focus, OUTPUT);
}
void loop()
{
unsigned long currentMillis = millis();
if(currentMillis - previousMillis > interval- focusDelay && focusBool){ //fire the focus before the shutter
digitalWrite(focus, HIGH);
digitalWrite(focus, LOW);
}
if(currentMillis - previousMillis > interval) {
// save the last time triggered the the Shutter
previousMillis = currentMillis;
digitalWrite(shutter, HIGH);
digitalWrite(shutter, LOW);
}
}
Gallery
The project owner hasn't added any images yet.
Design Files
Embed Code
Component (3)
Qty
Description
PC817X4NSZ0F
U166, U163
2
General Purpose Photocoupler
SJ-2523-SMT-TR
J6
1
2.5mm smd female phono connector
Resistor
R11, R10
2
Generic Resistor (360)