Forked from anonymous/Wireless Shutter for X100 Camera
Created
September 30, 2017 03:07
-
-
Save guitarmasaki/f02d3df7933d2abea44a8af5091f98f8 to your computer and use it in GitHub Desktop.
Arduino code for wireless "wired" shutter release
This file contains 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
/* | |
*************************** Wireless Shutter For X100 Camera ********************************************** | |
( cable release cameras ) | |
code for controlling a servo thats wirelessly triggered | |
Created 23 February 2013 | |
by Andrew D. Farquharson | |
More at www.handya.co.nz | |
******************************************************************************************************* | |
*/ | |
#include <Servo.h> | |
Servo servo; | |
int FocusButton = 12; | |
int ShootButton = 11; | |
int FocusState = 1; | |
int ShootState = 1; | |
int powerbutton = 13; | |
void setup() { | |
pinMode(FocusButton, INPUT); | |
pinMode(ShootButton, INPUT); | |
pinMode(powerbutton, OUTPUT); | |
servo.attach(10); // start servo | |
servo.write(35); | |
delay(1000); | |
digitalWrite(powerbutton, HIGH); // power on wireless module | |
delay(3000); | |
digitalWrite(powerbutton, LOW); | |
} | |
void loop() { | |
FocusState = digitalRead(FocusButton); //get wireless module state | |
ShootState = digitalRead(ShootButton); | |
if(FocusState == 0){ // drive servo to take photo | |
servo.write(120); | |
delay(500); | |
servo.write(35); | |
} | |
delay(10); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment