Hey all,
I have been struggling here with a LOLA droid build and wanted to get your input on how I should proceed with generating sound for it. Currently I am using 2 nanos, one to drive servos and the other to manage the sound. I have it working pretty well on the servo side, but I cannot seem to get the sound side of things. I originally got an SD card reader, tried some wav files, but they were very very quiet(had to hold it to my ear to hear it), they popped and crackled, and just over all did not sound good at all. I switched to using the tone() and the sound quality is great but very difficult to generate the tones i am looking to achieve.
hardware i am using is : SD card reader, LM386, and an 8ohm 2w speaker (i know these are not supposed to be hooked up to the board, but it is ok running through an amp, correct?)
testing code is basic and as follows
#include <Arduino.h>
#include <SD.h>
#include <TMRpcm.h>
#include<SPI.h>
#define speakerPin 9
#define SD_ChipSelectPin 4
TMRpcm sd;
bool soundPlaying = false;
void setup() {
Serial.begin(38400);
if (!SD.begin(SD_ChipSelectPin)) // returns 1 if the card is present
{
Serial.println("SD fail");
return;
}
Serial.println("SD Success");
sd.setVolume(6);
}
void loop() {
if(!soundPlaying){
soundPlaying = true;
sd.play("22Test.WAV");
delay(2000);
soundPlaying = false;
}
}
I am looking to switch to a DFP player as i cant seem to figure this out, and seems i am not the only one with this problem. My questions for you are:
- Do you see something I am missing?
and - Will the DFP be louder and more clear sound?
before i go throwing more money at this project i want to make sure i am not missing something and that the DFP will help.
