Wave Sheild Odd Issue

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Wave Sheild Odd Issue

Postby P3ach3s » Mon May 21, 2012 8:46 am

I was testing/building code on my UNO and Wave,

then once it worked like i wanted i changed the wave over to my 2560 MEGA.

and now i get an error:

WaveHC with
6buttons
Free RAM: 6228
Card init. failed!


SD I/O error: 1, FF

IT DOES WORK ON THE UNO FINE....NOT THE MEGA
What gives?
P3ach3s
 
Posts: 20
Joined: Sat May 19, 2012 8:27 pm

Re: Wave Sheild Odd Issue

Postby adafruit_support_bill » Mon May 21, 2012 8:57 am

The MEGA is not completely compatible with a standard Arduino. The Mega uses different pins for I2C and SPI. The wave-shield can be made to work with it as described in this thread:
http://forums.adafruit.com/viewtopic.php?f=31&t=10939
User avatar
adafruit_support_bill
 
Posts: 15986
Joined: Sat Feb 07, 2009 9:11 am

Re: Wave Sheild Odd Issue

Postby P3ach3s » Mon May 21, 2012 8:06 pm

Moderately irritating...but not upset. Is there a simple walkthrough then? Seeing as that forum post is muddled with different options. Is there a definite way to do this?
P3ach3s
 
Posts: 20
Joined: Sat May 19, 2012 8:27 pm

Re: Wave Sheild Odd Issue

Postby adafruit_support_bill » Tue May 22, 2012 5:03 am

In the end, it was decided that the original post was the best workaround.

2. Solution

NOTE: A more elegant (e.g. software-only) solution may be possible (see "3. Extra credit" below). For the time being, this works...

2.1 Close the Arduino IDE.
2.2 Download the two header files attached to this message: "dac.h" and "sd_raw_config.h", place them into arduino/hardware/libraries/AF_Wave/ replacing the original files.
2.3 Delete the ".o" object files sitting in the same directory.
2.4 Using diagonal cutters, clip the header pins connected to digital pins 11, 12 and 13 on the shield. See this picture: http://gregsadetsky.com/_files/ladyada- ... C_0093.JPG

2.5 Unsolder the jumper cable going from the "CCS" hole (next to the shield's reset button) to the digital pin 10 hole.
2.6 Make four 4-inch jumper cables; they should each be soldered on one side at: the "CCS" hole (see step 2.5), and the digital input/output holes 11, 12 and 13 on the shield. The other side of the four cables will connect with four of the Mega's digital pins. You should label the four cables with stickers.

See these pictures:
- http://gregsadetsky.com/_files/ladyada- ... C_0089.JPG
- http://gregsadetsky.com/_files/ladyada- ... C_0091.JPG

The cable going from the "CCS" hole on the shield connects with the digital pin 53 on the Mega.
The cable going from the digital input/output hole 11 on the shield connects with the digital pin 51 on the Mega.
The cable going from the digital input/output hole 12 on the shield connects with the digital pin 50 on the Mega.
The cable going from the digital input/output hole 13 on the shield connects with the digital pin 52 on the Mega.

2.7 You're done! You should be able to physically install the shield over the Mega, compile any example such as "PlayAllLoop", connect the Mega by USB and run it.

--------
User avatar
adafruit_support_bill
 
Posts: 15986
Joined: Sat Feb 07, 2009 9:11 am

Re: Wave Sheild Odd Issue

Postby P3ach3s » Tue May 22, 2012 7:12 pm

Awesome! this works...kinda.


When the audio plays the LEDs pause and wait for the sound to finish... any ideas on how to get the sounds to play WHILE the code is running?
P3ach3s
 
Posts: 20
Joined: Sat May 19, 2012 8:27 pm


Re: Wave Sheild Odd Issue

Postby P3ach3s » Tue May 22, 2012 9:12 pm

Here's the audio code giving the issues:

Code: Select all

void loop(void)
{
byte i;

{
   if (justpressed[0]) {
      justpressed[0] = 0;
      playfile("ON.WAV");
  }
   if (justpressed[1] ){
    justpressed[1] = 0;
    playfile("LOOP.WAV");
    while (wave.isplaying && pressed[1]) {
      //Serial.print(".");
    }
    wave.stop();
playfile("OFF.WAV");   
  }

}


when the button is held for #1 the LED sequence pauses. The code resumes when off is playing.
P3ach3s
 
Posts: 20
Joined: Sat May 19, 2012 8:27 pm

Re: Wave Sheild Odd Issue

Postby adafruit_support_bill » Wed May 23, 2012 4:49 am

I don't see any led sequence there, but you do have a tight loop that will do nothing while the file plays:
Code: Select all
    while (wave.isplaying && pressed[1]) {
      //Serial.print(".");
    }
User avatar
adafruit_support_bill
 
Posts: 15986
Joined: Sat Feb 07, 2009 9:11 am

Re: Wave Sheild Odd Issue

Postby P3ach3s » Wed May 23, 2012 5:04 am

nevermind...figured it out thanks for the directions!
P3ach3s
 
Posts: 20
Joined: Sat May 19, 2012 8:27 pm

Re: Wave Sheild Odd Issue

Postby Lastborn » Mon Jul 23, 2012 9:12 am

Hi,

I am getting the same problem on my MEGA 2560. I have remapped the pins as described but I am using the updated waveHC library and the error i keep getting is card.init() failed. SD error 1, 0 i.e error code 1, error data 0. Please help.

Thanks.
Lastborn
 
Posts: 28
Joined: Mon Jul 23, 2012 9:01 am

Re: Wave Sheild Odd Issue

Postby adafruit_support_bill » Mon Jul 23, 2012 10:06 am

Have you had the shield working with a regular Arduino?
User avatar
adafruit_support_bill
 
Posts: 15986
Joined: Sat Feb 07, 2009 9:11 am

Re: Wave Sheild Odd Issue

Postby Lastborn » Mon Jul 23, 2012 7:53 pm

I will try it with an UNO and let you know of the outcome. Cheers
Lastborn
 
Posts: 28
Joined: Mon Jul 23, 2012 9:01 am

Re: Wave Sheild Odd Issue

Postby Lastborn » Tue Jul 24, 2012 8:34 am

Hi, I just tried it with the my UNO and it works fine. recognizes the SD card and its formatting and it plays the wav files in the root folder perfectly. But it still doesn't work on my MEGA 2560.
Lastborn
 
Posts: 28
Joined: Mon Jul 23, 2012 9:01 am

Re: Wave Sheild Odd Issue

Postby adafruit_support_bill » Tue Jul 24, 2012 9:23 am

Hi, I just tried it with the my UNO and it works fine.
That's good. It rules out any basic problems with the assembly.

I have remapped the pins as described
The change requires both cut & jumpering of pins and corresponding modifications to the library. Have you done both?
User avatar
adafruit_support_bill
 
Posts: 15986
Joined: Sat Feb 07, 2009 9:11 am

Re: Wave Sheild Odd Issue

Postby Lastborn » Tue Jul 24, 2012 9:31 am

I have only remapped the pins as follows: 10 --> 53, 11-->50, 12-->51 and 13-->52. I have not modified anything in the waveHC library I'm afraid.
Lastborn
 
Posts: 28
Joined: Mon Jul 23, 2012 9:01 am

Next

Return to Arduino Shields from Adafruit

Who is online

Users browsing this forum: No registered users and 7 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [100]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[108]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[69]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]