Created
October 23, 2015 08:52
-
-
Save rob-smallshire/7dd55f37035f3d57001c to your computer and use it in GitHub Desktop.
Arduino sketch for a slide scanner using a GAF 503 slide projector and a Canon 20D camera
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int NUM_SLIDES = 50; | |
// Pin 2 has a slide projector connected | |
int PROJECTOR_ADVANCE_PIN = 2; | |
int CAMERA_FOCUS_PIN = 3; | |
int CAMERA_SHUTTER_PIN = 4; | |
int ARDUINO_LED_PIN = 13; | |
// the setup routine runs once when you press reset: | |
void setup() { | |
pinMode(PROJECTOR_ADVANCE_PIN, OUTPUT); | |
digitalWrite(PROJECTOR_ADVANCE_PIN, HIGH); //.Relay is active-low | |
pinMode(CAMERA_FOCUS_PIN, OUTPUT); | |
digitalWrite(CAMERA_FOCUS_PIN, LOW); | |
pinMode(CAMERA_SHUTTER_PIN, OUTPUT); | |
digitalWrite(CAMERA_SHUTTER_PIN, LOW); | |
pinMode(ARDUINO_LED_PIN, OUTPUT); | |
digitalWrite(ARDUINO_LED_PIN, LOW); | |
delay(10000); | |
} | |
void loop() { | |
digitalWrite(ARDUINO_LED_PIN, HIGH); | |
for (int i = 0; i <= NUM_SLIDES; ++i) { | |
digitalWrite(PROJECTOR_ADVANCE_PIN, LOW); | |
delay(1000); | |
digitalWrite(PROJECTOR_ADVANCE_PIN, HIGH); | |
delay(2000); | |
digitalWrite(CAMERA_FOCUS_PIN, HIGH); | |
delay(500); | |
digitalWrite(CAMERA_SHUTTER_PIN, HIGH); | |
delay(500); | |
digitalWrite(CAMERA_SHUTTER_PIN, LOW); | |
digitalWrite(CAMERA_FOCUS_PIN, LOW); | |
delay(500); | |
} | |
digitalWrite(ARDUINO_LED_PIN, LOW); | |
while (1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment