Skip to content

Instantly share code, notes, and snippets.

@maniacbug
Created February 26, 2012 16:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maniacbug/1917486 to your computer and use it in GitHub Desktop.
Save maniacbug/1917486 to your computer and use it in GitHub Desktop.
Controlling Sony A100 using 2x 4N25's
/*
Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
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