Skip to content

Instantly share code, notes, and snippets.

@tagliati
Created November 28, 2012 10:43
Show Gist options
  • Save tagliati/4160433 to your computer and use it in GitHub Desktop.
Save tagliati/4160433 to your computer and use it in GitHub Desktop.
Simple arduino code to shoot using chdk
/*
Camera shooter.
Simple code to use in a usb remote control using chdk
Using TwoPress switch mode
*/
void setup() {
// pin 13 is just to view the status of trigger cycle
pinMode(13, OUTPUT);
// trigger pin
pinMode(9,OUTPUT);
}
void loop() {
// Shoot half - prepare to shoot ( charge flash, focus/ exposure)
digitalWrite(9,HIGH);
digitalWrite(13,HIGH);
// wait 5 sec in this state.
delay(5000);
//release the button
digitalWrite(9,LOW);
digitalWrite(13, LOW);
delay(5);
// shoot full
digitalWrite(9,HIGH);
digitalWrite(13,HIGH);
delay(200);
digitalWrite(9,LOW);
digitalWrite(13,LOW);
delay(16000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment