Can the WAVE Shield make sound without the SD?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- pabluski
- Posts: 4
- Joined: Mon Nov 10, 2014 6:34 pm
Can the WAVE Shield make sound without the SD?
I have a project that is using the Wave Shield with the SD - works nicely. However, there have been occasions where the SD card takes an I/O error. Usually the SD has been jarred and needs to be re-seated. On those occasions it would be very helpful to be able to produce an error tone or a beep-beep-beep or something like that. Is this possible with the Wave Shield or can it only be fed through the SD?
- kk6axq
- Posts: 1
- Joined: Wed Jan 14, 2015 6:48 pm
Re: Can the WAVE Shield make sound without the SD?
You could generate the tone on the Arduino and then wire a pin onto the signal pin of the audio jack... See the Arduino reference page for tone();
Hope that helps,
Hope that helps,
- pabluski
- Posts: 4
- Joined: Mon Nov 10, 2014 6:34 pm
Re: Can the WAVE Shield make sound without the SD?
Yeah, I also considered putting a peizo device on there and trigger it with one of the pins.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Can the WAVE Shield make sound without the SD?
This thread has code from someone sending data directly to the Wave Shield's DAC:
http://forums.adafruit.com/viewtopic.ph ... 75#p106122
http://forums.adafruit.com/viewtopic.ph ... 75#p106122
- pabluski
- Posts: 4
- Joined: Mon Nov 10, 2014 6:34 pm
Re: Can the WAVE Shield make sound without the SD?
Mike, That is what I was looking for. Thanks.
I added this routine to my sketch:
And then I call it this way for a "powering down" sound, or an error beep sequence:
I added this routine to my sketch:
Code: Select all
void dac_tone(int play4, int dlay) {
for(int y=0;y<play4;y++){
for(int i=0;i<360;i++) {
wdt_reset (); // pat the dog
mcpDacSend(255*sin(i));
delayMicroseconds(dlay);
}
}
}
Code: Select all
void powerdown(int beeps) {
pinMode(SHUSH_PIN,OUTPUT); //disable the shush pin
if(beeps>0) {
dac_tone(10,1);
delay(500);
for(int i=0;i<beeps;i++){
dac_tone(1,5);
delay(100);
}
delay(500);
dac_tone(10,1);
} else {
dac_tone(1,5);
dac_tone(1,10);
dac_tone(1,20);
dac_tone(1,40);
dac_tone(1,80);
}
digitalWrite(POWDOWN_PIN,1); // tell the Pololu module to cut power
while(1); // hang
}
Please be positive and constructive with your questions and comments.