Skip to content

Instantly share code, notes, and snippets.

@tagliati
Created December 9, 2012 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tagliati/4247170 to your computer and use it in GitHub Desktop.
Save tagliati/4247170 to your computer and use it in GitHub Desktop.
taking pictures with laser trigger
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
int sensorValue = 0; // value read from the pot
void setup() {
// initialize serial communications at 9600 bps:
//Serial.begin(9600);
pinMode(9,OUTPUT);
}
void loop() {
digitalWrite(9,HIGH);
sensorValue = analogRead(analogInPin);
if(sensorValue < 100){
//take a picture
digitalWrite(9,LOW);
delay(5);
digitalWrite(9,HIGH);
delay(200);
digitalWrite(9,LOW);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment