Issue on Arduino code using Adafruit Waveshield

Hi All!
I am developing an academic project that consists in using an Adafruit Wave Shield along with an Arduino Uno.
The purpose is to decode Braille into voice.
I have 6 switches, each one representing one of the 6 dots that makes a Braille character.
Summing up, we select the switches that will be on (or off) and after thar we click one last wsitch that gives the order for the proper audio file (with the correspondent letter) to be played.
Please note that the if cycles are not yet on the code.
My only issue is that after inserting the parts relating the waveshield in the code, the buttonPin7 just stops working. If I remove those parts, it works perfectly.
Any ideas?

In attachment you have the a.txt file with the non working button7
and the b.txt with the working witch buit without the audio part

void sdErrorCheck(void)
{
if (!card.errorCode()) return;
putstring("\n\rSD I/O error: ");
Serial.print(card.errorCode(), HEX);
putstring(", ");
Serial.println(card.errorData(), HEX);
while(1);
}

void setup() {
Serial.begin(9600);

// initialize the LED pin as an output:
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(ledPin4, OUTPUT);
pinMode(ledPin5, OUTPUT);
pinMode(ledPin6, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin1, INPUT);
digitalWrite(buttonPin1, HIGH);

pinMode(buttonPin2, INPUT);
digitalWrite(buttonPin2, HIGH);

pinMode(buttonPin3, INPUT);
digitalWrite(buttonPin3, HIGH);
pinMode(buttonPin4, INPUT);
digitalWrite(buttonPin4, HIGH);

pinMode(buttonPin5, INPUT);
digitalWrite(buttonPin5, HIGH);

pinMode(buttonPin6, INPUT);
digitalWrite(buttonPin6, HIGH);

pinMode(buttonPin7, INPUT);
digitalWrite(buttonPin7, HIGH);

// Set the output pins for the DAC control. This pins are defined in the library
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
// if (!card.init(true)) { //play with 4 MHz spi if 8MHz isn't working for you
if (!card.init()) { //play with 8 MHz spi (default faster!)
putstring_nl("Card init. failed!"); // Something went wrong, lets print out why
sdErrorCheck();
while(1); // then 'halt' - do nothing!
}

// enable optimize read - some cards may timeout. Disable if you're having problems
card.partialBlockRead(true);

// Now we will look for a FAT partition!
uint8_t part;
for (part = 0; part < 5; part++) { // we have up to 5 slots to look in
if (vol.init(card, part))
break; // we found one, lets bail
}
if (part == 5) { // if we ended up not finding one :frowning:
putstring_nl("No valid FAT partition!");
sdErrorCheck(); // Something went wrong, lets print out why
while(1); // then 'halt' - do nothing!
}

// Try to open the root directory
if (!root.openRoot(vol)) {
putstring_nl("Can't open root dir!"); // Something went wrong,
while(1); // then 'halt' - do nothing!
}

}
void loop(){

// read the state of the pushbutton value:
buttonState1 = digitalRead(buttonPin1);
// Verifica se o botão se encontra primido e se ainda não foi tratado
if(buttonState1==HIGH && buttonStatemem1==LOW)
{
if(luzon1 == 0)
{
luzon1 = 1;
}
else
{
luzon1 = 0;
}
buttonStatemem1=HIGH;
}
else if(buttonState1==LOW)
{
buttonStatemem1=LOW;
}

//Liga ou desliga a o Led (luz)
if(luzon1 == 0)
{
digitalWrite(ledPin1, LOW);
}
else
{
digitalWrite(ledPin1, HIGH);
}

// Envia o estado da luz
Serial.print("| LED 1 ");
Serial.print(luzon1);
delay(5);

buttonState2 = digitalRead(buttonPin2);
// Verifica se o botão se encontra primido e se ainda não foi tratado
if(buttonState2==HIGH && buttonStatemem2==LOW)
{
if(luzon2 == 0)
{
luzon2 = 1;
}
else
{
luzon2 = 0;
}
buttonStatemem2=HIGH;
}
else if(buttonState2==LOW)
{
buttonStatemem2=LOW;
}

//Liga ou desliga a o Led (luz)
if(luzon2 == 0)
{
digitalWrite(ledPin2, LOW);
}
else
{
digitalWrite(ledPin2, HIGH);
}

// Envia o estado da luz
Serial.print("| LED 2 ");
Serial.print(luzon2);
delay(5);

buttonState3 = digitalRead(buttonPin3);
// Verifica se o botão se encontra primido e se ainda não foi tratado
if(buttonState3==HIGH && buttonStatemem3==LOW)
{
if(luzon3 == 0)
{
luzon3 = 1;
}
else
{
luzon3 = 0;
}
buttonStatemem3=HIGH;
}
else if(buttonState3==LOW)
{
buttonStatemem3=LOW;
}

//Liga ou desliga a o Led (luz)
if(luzon3 == 0)
{
digitalWrite(ledPin3, LOW);
}
else
{
digitalWrite(ledPin3, HIGH);
}

// Envia o estado da luz
Serial.print("| LED 3 ");
Serial.print(luzon3);
delay(5);

buttonState4 = digitalRead(buttonPin4);
// Verifica se o botão se encontra primido e se ainda não foi tratado
if(buttonState4==HIGH && buttonStatemem4==LOW)
{
if(luzon4 == 0)
{
luzon4 = 1;
}
else
{
luzon4 = 0;
}
buttonStatemem4=HIGH;
}
else if(buttonState4==LOW)
{
buttonStatemem4=LOW;
}

//Liga ou desliga a o Led (luz)
if(luzon4 == 0)
{
digitalWrite(ledPin4, LOW);
}
else
{
digitalWrite(ledPin4, HIGH);
}

// Envia o estado da luz
Serial.print("| LED 4 ");
Serial.print(luzon4);
delay(5);

buttonState5 = digitalRead(buttonPin5);
// Verifica se o botão se encontra primido e se ainda não foi tratado
if(buttonState5==HIGH && buttonStatemem5==LOW)
{
if(luzon5 == 0)
{
luzon5 = 1;
}
else
{
luzon5 = 0;
}
buttonStatemem5=HIGH;
}
else if(buttonState5==LOW)
{
buttonStatemem5=LOW;
}

//Liga ou desliga a o Led (luz)
if(luzon5 == 0)
{
digitalWrite(ledPin5, LOW);
}
else
{
digitalWrite(ledPin5, HIGH);
}

// Envia o estado da luz
Serial.print("| LED 5 ");
Serial.print(luzon5);
delay(5);

buttonState6 = digitalRead(buttonPin6);
// Verifica se o botão se encontra primido e se ainda não foi tratado
if(buttonState6==HIGH && buttonStatemem6==LOW)
{
if(luzon6 == 0)
{
luzon6 = 1;
}
else
{
luzon6 = 0;
}
buttonStatemem6=HIGH;
}
else if(buttonState6==LOW)
{
buttonStatemem6=LOW;
}

//Liga ou desliga a o Led (luz)
if(luzon6 == 0)
{
digitalWrite(ledPin6, LOW);
}
else
{
digitalWrite(ledPin6, HIGH);
}

// Envia o estado da luz
Serial.print("| LED 6 ");
Serial.print(luzon6);
delay(5);

buttonState7 = digitalRead(buttonPin7);
// Verifica se o botão se encontra primido e se ainda não foi tratado
if(buttonState7==HIGH && buttonStatemem7==LOW)
{
if(luzon7 == 0)
{
luzon7 = 1;
}
else
{
luzon7 = 0;
}
buttonStatemem7=HIGH;
}
else if(buttonState7==LOW)
{
buttonStatemem7=LOW;
}

/*
//Liga ou desliga a o Led (luz)
if(luzon6 == 0)
{
digitalWrite(ledPin6, LOW);
}
else
{
digitalWrite(ledPin6, HIGH);
}
*/
// Envia o estado da luz
Serial.print("| START ");
Serial.println(luzon7);
delay(5);

if ((luzon1 ==0)&& (luzon2==0)){
playcomplete("adios.WAV");
luzon1 =1;
luzon2 =1;
}
}
// Plays a full file from beginning to end with no pause.
void playcomplete(char *name) {
// call our helper to find and play this name
playfile(name);
while (wave.isplaying) {
// do nothing while its playing
}
// now its done playing
}

void playfile(char *name) {
// see if the wave object is currently doing something
if (wave.isplaying) {// already playing something, so stop it!
wave.stop(); // stop it
}
// look in the root directory and open the file
if (!f.open(root, name)) {
putstring("Couldn't open file "); Serial.print(name); return;
}
// OK read the file and turn it into a wave object
if (!wave.create(f)) {
putstring_nl("Not a valid WAV"); return;
}

// ok time to play! start playback
wave.play();
}

a.txt (8.54 KB)

b.txt (7.37 KB)