Go Down

Topic: Led follow a mps file (heartbeat) (Read 67 times) previous topic - next topic

SeSamino

Jan 20, 2016, 11:38 am Last Edit: Jan 20, 2016, 01:26 pm by SeSamino
I am trying to make a LED follow a heartbeat, like this.
https://www.youtube.com/watch?v=27Ab2SaAZPQ


Is there a way to array a mp3 file to how long the delay should be?

Making a LED follow a mp3 file.

I am not thinking af the led sould react to sound as input. Like connecting a sound sencor to the LED.
                                _____________

The point is to have a robot with a normal heartbeat. (A sound of a heart beat follow a LED)
When you get to close the robots heart (LED with the heart beat sound) increases.

DVDdoug

With an "artificial" heartbeat it might be easier to program the sound and LED together (controlled by the same software) rather than by detecting the heartbeat.

But,  you can make a sound activated effect.    If you have a "normal" line-level or headphone-level audio signal, you need to bias the input (2 equal-value resistors and a capacitor).    Then you simply set a threshold i.e. If analogRead is greater than 800, turn on the LED.   (800 is just a made-up number...  You'll have to check your input level and experiment.

You may not need a delay, but you might want to hold-on the LED for something like 100-500mS every time it's triggered.

Grumpy_Mike

Quote
Is there a way to array a mp3 file to how long the delay should be?
No there is no way to do anything on a Arduino with an MP3 file unless you have external hardware.

You can output a simple WAV file, and without extra memory ( that is an SD card ) you can play back about 3.5 seconds of audio on a Uno.


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy