Skip to content

Instantly share code, notes, and snippets.

/gist:14402daf790ce7a6b670 Secret
Created Feb 11, 2013

Embed
What would you like to do?
/* 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
You can’t perform that action at this time.