I'm creating the simple audio player from the Arduino site:
It runs well when connected to the computer's USB, but not when connected to a USB wall plug as there is no sound. This will be used remotely for 2 months so I do not want to use a battery.
I've checked the voltages the VCC pin shows 3.24V for either connector, and the DAC0 shows 0.40V for the computer USB and 0.10V for the wall USB.
I've pushed the reset button twice quickly, and it flashes continuously for the wall usb, and doesn't otherwise correct any problems.
Any insights are appreciated! thanks
{
#include <SD.h>
#include <SPI.h>
#include <AudioZero.h>
const int chipSelect = SDCARD_SS_PIN;
int iCount = 0;
bool bPlayed=false;
Sd2Card card;
SdVolume volume;
SdFile root;
void setup() {
delay(5000);
Serial.println("Starting Setup");
// debug output at 9600 baud
Serial.begin(9600);
// setup SD-card
while (!Serial) {
;
}
Serial.println("Initializing SD card...");
//
if (!SD.begin(chipSelect)) {
Serial.println("1 failed!");
while (true);
}
AudioZero.begin(44100);
}
void loop() {
Serial.println("loop starts");
if (!bPlayed)
{
playFile("thunder.wav");
//playFile("geese2.wav");
//playFile("coyote2.wav");
//playFile("bison1.wav");
//playFile("bison2.wav");
}
}
void playFile(char fileName[])
{
long lExists = SD.exists(fileName);
Serial.print("file exists: ");
Serial.println(lExists);
File soundFile = SD.open(fileName);
Serial.print("SoundFile check: ");
Serial.println(soundFile);
if (!soundFile)
{
// if the file didn't open, print an error and stop
Serial.print("error opening ");
Serial.println(fileName);
while (true);
}
else
{
Serial.print("Playing ");
Serial.print(fileName);
AudioZero.play(soundFile);
Serial.println("End of file. Thank you for listening!");
Serial.println("Count");
Serial.println(iCount);
AudioZero.end();
iCount = iCount + 1;
}
}