/gist:14402daf790ce7a6b670 Secret
Created
February 11, 2013 21:31
Star
You must be signed in to star a gist
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
/* Arduino High Speed Photography | |
Micrófono colocado en Analog0 con una resistencia pull-down de 1k | |
*/ | |
int ledPin = 13; | |
int time = 2; // Tiempo entre que se detecta el sonido y salta el flash | |
int sensibility = 40; // Sensibilidad (>37) | |
void setup() | |
{ | |
pinMode(ledPin, OUTPUT); | |
} | |
void loop() | |
{ | |
if (analogRead(0) > sensibility) | |
{ | |
delay(time); | |
digitalWrite(ledPin, HIGH); | |
delay(250); | |
digitalWrite(ledPin, LOW); | |
delay(1000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment