However, for my application, the code is a bit slow.
My application is simply to play a short, single-word, which is the only file on the SD card.
I want to play this word when a sensor is triggered.
And it actually all works! But the delay from the time the sensor fires
until the file plays is far too long for my application.
If I skip the wave shield altogether and just sound a buzzer right
off the arduino, the timing is perfect -- but I really want to play the .WAV
file instead of using a buzzer.
So, is there a way to make this .WAV start playing faster than this.....
My loop() is:
Code: Select all
void loop() {
int sensorValue = 0;
sensorValue = analogRead(sensorPin);
if (sensorValue > sensorThreshold)
{
playcomplete("myfile.WAV");
}
}