@ GoForSmoke I guess 100 milliseconds is a while in cycles.
Don't blink you'll miss it!
Wikipedia:
The average length of a blink is 100-400 milliseconds.
@JustDoc Could you post your whole code?
We can only help by what info you give.
With the code you posted
void PlayVoiceOne() {
Serial.println("amp on start ");
digitalWrite(AMPpin, HIGH);
delay(1000);
Serial.println("amp on complete ");
//delay(50);
Serial.println("play start");
wtv020sd16p.playVoice(1);
// this is where it locks up
Serial.println("play done");
//delay(100);
//wtv020sd16p.stopVoice();
Serial.println("amp off start");
digitalWrite(AMPpin, LOW);
Serial.println("amp off end");
}
The problem LOOKS to be that you are shutting the amp off as soon as the sound starts.
But you say it "locks up" even without the amp.
Explain a bit better what you mean by "locks up".
You said
Right after it plays a sound, it locks up.
Does it completely play the sound? Or just start to?
If it plays a bit then "locks up" maybe you should read this:
http://forum.arduino.cc/index.php?topic=115411.0Scroll down to where fungus talks about supplying 3.6v to the module.
Here is a schematic showing how to get the 3.6v:
http://forum.arduino.cc/index.php?action=dlattach;topic=115411.0;attach=42690;imageHow are you wired up? Can you show a pic of the connections?
Did you connect it like shown in the second post of this thread?
Aside from your //comments which would lead to error and the fact that you are turning the amp off immediately after the sound starts your function looks ok.
How are you wired up? Can you show a pic of the connections?
edit:Also try this:
void PlayVoiceOne() {
Serial.println("amp on start ");
digitalWrite(AMPpin, HIGH);
delay(1000);
Serial.println("amp on complete ");
Serial.println("play start");
wtv020sd16p.playVoice(0); // Added this
wtv020sd16p.asyncPlayVoice(1);
// this is where it locks up
Serial.println("play done");
Serial.println("amp off start");
digitalWrite(AMPpin, LOW);
Serial.println("amp off end");
}
This sketch plays track 1 start through finish for me I just tried it:
#include <Wtv020sd16p.h>
int resetPin = 2; // The pin number of the reset pin.
int clockPin = 3; // The pin number of the clock pin.
int dataPin = 4; // The pin number of the data pin.
/*
Create an instance of the Wtv020sd16p class.
1st parameter: Reset pin number.
2nd parameter: Clock pin number.
3rd parameter: Data pin number.
*/
Wtv020sd16p wtv020sd16p(resetPin,clockPin,dataPin,busyPin);
void setup() {
//Initializes the module.
wtv020sd16p.reset();
delay(100); // needed after reset
wtv020sd16p.playVoice(0);
//Plays asynchronously an audio file.
wtv020sd16p.asyncPlayVoice(1);
}
void loop() {
// Nothing here
}