Voice Box Shield + Push button

i have a problem,

i tried to interface the arduino uno with the voice shield box (http://www.sparkfun.com/products/9799) from spark fun that using a SPEAKJET IC.
the problem is, by using the pull-up resistor…

when i press button 1… it will say the “ROGER-ROGER” pharse…
but,
when i press button 2… it will make a “PING sound” and it still repeating the “ROGER-ROGER” pharse…

what i’m trying to do is…
if button 1 press … say “roger2”…
if button 2 press… sound a “Ping Sound effect”… but not repeating the roger2 pharse

here is my coding:

// speakjet IC
#include <SoftwareSerial.h>
#define txPin 2
#define rxPin 3
SoftwareSerial speakJet = SoftwareSerial(rxPin, txPin);

//text
char pingSound = {20, 96, 21, 114, 22, 88, 23, 5, 252};
char sayThis = {20, 96, 21, 120, 22, 120, 23, 12, 148, 135, 165, 151, 8, 148, 135, 165, 151};

// push button
int inPin1 = 6;
int inPin2 = 7;
int val=0;
int val2=0;

void setup()
{
// begin a serial Port
Serial.begin(9600);

// Speakjet IC
pinMode(txPin, OUTPUT);
speakJet.begin(9600);
delay(1000);

// push button
pinMode(inPin1, INPUT);
pinMode(inPin2, INPUT);
}

void loop()
{
// Push button 1
//pin 6
val=digitalRead(inPin1);
if(val == LOW)
{
speakJet.print(sayThis); //roger2
delay (1000);
}

//push button2
//pin 7
val2=digitalRead(inPin2);
if(val2 == LOW)
{
speakJet.print(pingSound); //ping
delay (1000);
}

}

is there any problem with the coding??

:cold_sweat: :cold_sweat: :cold_sweat:

Increase delay to 2000?

liudr: Increase delay to 2000?

same result.. when button 2 been pressed, it still saying the roger2 after the Ping sound effect..

I wish I had the hardware. Sounds really like fun. What if you use digital pins 14 and 15 for buttons? They are the same pins as analog 0 and 1. I suspect the speakjet chip is connected to arduino pin 2-13 and somehow pin 7 is connected to maybe a repeat function. I read the diagram but not the speakjet spec.

liudr: I wish I had the hardware. Sounds really like fun. What if you use digital pins 14 and 15 for buttons? They are the same pins as analog 0 and 1. I suspect the speakjet chip is connected to arduino pin 2-13 and somehow pin 7 is connected to maybe a repeat function. I read the diagram but not the speakjet spec.

thanx for your help... actually the coding should look like this

char pingSound[] = {20, 96, 21, 114, 22, 88, 23, 5, 252, 0};
char sayThis[] = {20, 96, 21, 120, 22, 120, 23, 12, 148, 135, 165, 151, 8, 148, 135, 165, 151, 0};

instead of

char pingSound[] = {20, 96, 21, 114, 22, 88, 23, 5, 252};
char sayThis[] = {20, 96, 21, 120, 22, 120, 23, 12, 148, 135, 165, 151, 8, 148, 135, 165, 151};

because of the string it should end with "0"..