Created
February 26, 2012 16:16
-
-
Save maniacbug/1917486 to your computer and use it in GitHub Desktop.
Controlling Sony A100 using 2x 4N25's
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
/* | |
Copyright (C) 2011 J. Coliz <[email protected]> | |
This program is free software; you can redistribute it and/or | |
modify it under the terms of the GNU General Public License | |
version 2 as published by the Free Software Foundation. | |
*/ | |
#include <avr/pgmspace.h> | |
// | |
// Hardware | |
// | |
const int focus_pin = 13; | |
const int shutter_pin = 12; | |
// | |
// Application | |
// | |
void setup(void) | |
{ | |
// Pin setup | |
pinMode(focus_pin,OUTPUT); | |
digitalWrite(focus_pin,LOW); | |
pinMode(shutter_pin,OUTPUT); | |
digitalWrite(shutter_pin,LOW); | |
// Preamble | |
Serial.begin(57600); | |
Serial.println(__FILE__); | |
Serial.println("Press any key to take a picture"); | |
} | |
void loop(void) | |
{ | |
if (Serial.available() ) | |
{ | |
Serial.read(); | |
Serial.println("FOCUS"); | |
digitalWrite(focus_pin,HIGH); | |
delay(500); | |
Serial.println("SHUTTER"); | |
digitalWrite(shutter_pin,HIGH); | |
delay(500); | |
Serial.println("OFF"); | |
digitalWrite(shutter_pin,LOW); | |
digitalWrite(focus_pin,LOW); | |
} | |
} | |
// vim:cin:ai:sts=2 sw=2 ft=cpp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment