Skip to content

Instantly share code, notes, and snippets.

Created February 11, 2013 21:31
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 anonymous/14402daf790ce7a6b670 to your computer and use it in GitHub Desktop.
Save anonymous/14402daf790ce7a6b670 to your computer and use it in GitHub Desktop.
/* 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