Seeeduino Music Shield: Possibility of digital trigger record?

Hi,
I have encountered a problem I lack the direction to fix. I need a push in the right direction.

I want the record function of a seeeduino music shield to be triggered by an accelerometer via a Arduino MEGA. The problem being the record function is currently set so that you have to

Press play/stop knob before pressing the RESET button of Arduino.
Release RESET button for a second and then release play/stop knob.
When the music shield is beginning to record, the green and red LEDs will blink synchronous.
Press play/stop knob will stop recording.

The demo code for the shield is

#include <avr/io.h>
#include "config.h"
#include "filesys.h"
#include "player.h"
#include "vs10xx.h"
#include "record.h"
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3);//pin2-Rx,pin3-Tx(note: pin3 is actually later used as volume down input)

void setup()
{
  Serial.begin(9600);
  //Serial.println("Hello test!");
  mySerial.begin(19200);// used for receiving command data from the iPod dock.
  
  InitSPI();

  InitIOForVs10xx();

  InitIOForKeys();
  
  InitIOForLEDs();

  InitFileSystem();

  //VsSineTest();

  Mp3Reset();
  
}


void loop()
{ 
#if defined(__AVR_ATmega1280__)|| defined(__AVR_ATmega2560__)
   // If play/stop button is pressed during boot, enter recording.
   if (0== PSKey)
   {
  	 delay(20);
	 while(0 == PSKey);
	 delay(20);
        Record();
   }
#endif

   Play();  
   while(1);
}

I'm trying to integrate it into this accelerometer code that will currently 'do something' when the arduino is tilted past 30 Degrees on the x or y axis. If there is a way of doing it with an 'if' statement then I am already set up for that.

// these constants describe the pins. They won't change:
const int groundpin = 66;             // analog input pin 4 -- ground
const int powerpin = 67;              // analog input pin 5 -- voltage
const int xpin = A11;                  // x-axis of the accelerometer
const int ypin = A10;                  // y-axis
const int zpin = A9;                  // z-axis (only on 3-axis models)

void setup()
{
  // initialize the serial communications:
  Serial.begin(9600);
  
  // Provide ground and power by using the analog inputs as normal
  // digital pins.  This makes it possible to directly connect the
  // breakout board to the Arduino.  If you use the normal 5V and
  // GND pins on the Arduino, you can remove these lines.
  pinMode(groundpin, OUTPUT);
  pinMode(powerpin, OUTPUT);
  digitalWrite(groundpin, LOW); 
  digitalWrite(powerpin, HIGH);
}

void loop()
{
  // print the sensor values:
  Serial.print(analogRead(xpin));
  // print a tab between values:
  Serial.print("\t");
  Serial.print(analogRead(ypin));
  // print a tab between values:
  Serial.print("\t");
  Serial.print(analogRead(zpin));
  Serial.println();
  // delay before next reading:
  delay(100);
  
  if (analogRead(xpin) > 589 ||analogRead(xpin) < 433||analogRead(ypin) > 589 ||analogRead(ypin) < 433  )
 {
  
 }
else
{
  
}
}

The problem being I do not know how and I need a hint from someone with more experience than myself.

Might I have to write or edit some library pages?

Is it the hardware on the Music Shield that is already set to record in this way? If so, can it be changed within the Arduino 1.0 software?

I'm not sure where to go from here. Thank you in advance for any light you can shed on this subject.

Stu

I'm going to try

void (*softReset) (void) = 0; //declare reset function @ address 0
softReset();

and

//digitalPin 7 is connected to the RESET pin on Arduino
//NOTE: you CANNOT program the board while they are connected
//by default digitalPin 13 will blink upon reset, so stick an LED in there

int interval = 5000;
long int time = 0;

void setup(){
  digitalWrite(7, HIGH); //We need to set it HIGH immediately on boot
  pinMode(7,OUTPUT);     //We can declare it an output ONLY AFTER it's HIGH
                         // (( HACKHACKHACKHACK ))
  Serial.begin(9600);    //So you can watch the time printed
}


void loop(){

  time = millis();
  
  Serial.println(time);
  
  if(time > interval){
    Serial.println("RESET!");
    digitalWrite(7, LOW); //Pulling the RESET pin LOW triggers the reset.
  }
}

http://www.forums.adafruit.com/viewtopic.php?f=8&t=15435

And rig up something to keep a current running through the Play/Pause control until just after the reset.

I'm not sure what yet.

Suggestions would be appreciated.

I currently have the accelerometer's angle effecting the record or play functions when the arduino is reset.
I want the reset to be controlled by the accelerometer as well.
A0 is used for Reset of VS1053.
Is it possible to reset the shield with this?

Here is my code and project.

#include <avr/io.h>
#include "config.h"
#include "filesys.h"
#include "player.h"
#include "vs10xx.h"
#include "record.h"
#include <SoftwareSerial.h>

const int groundpin = 66;             // analog input pin 4 -- ground
const int powerpin = 67;              // analog input pin 5 -- voltage
const int xpin = A11;                  // x-axis of the accelerometer
const int ypin = A10;                  // y-axis od the accelerometer

SoftwareSerial mySerial(2, 3);//pin2-Rx,pin3-Tx(note: pin3 is actually later used as volume down input(not needed))

void setup()
{
  Serial.begin(9600);
  //Serial.println("Hello test!");
  
  // Provide ground and power by using the analog inputs as normal
  // digital pins.  This makes it possible to directly connect the
  // breakout board to the Arduino.
  pinMode(groundpin, OUTPUT);
  pinMode(powerpin, OUTPUT);
  digitalWrite(groundpin, LOW); 
  digitalWrite(powerpin, HIGH);
  
  InitSPI();

  InitIOForVs10xx();

  InitIOForKeys();
  
  InitIOForLEDs();

  InitFileSystem();

  //VsSineTest();

  Mp3Reset();
}



void loop()

{ 
    // print the sensor values:
  Serial.print(analogRead(xpin));
  // print a tab between values:
  Serial.print("\t");
  Serial.print(analogRead(ypin));
  // print a tab between values:
  Serial.print("\t");
  Serial.println();
  
  /*
Set X&Y axis to light up an LED if the accelerometer tips past 30 degrees in any direction from flat.
|| means 'as well as'
< and > mean greater or less than
*/  

// If the bottle tips past 30 degrees on the X or Y axis, record. If not, Playback.
   if (analogRead(xpin) > 589 ||analogRead(xpin) < 433||analogRead(ypin) > 589 ||analogRead(ypin) < 433  )
  {
   Play();  
   while(0);    
  }
else
  {
  #if defined(__AVR_ATmega1280__)|| defined(__AVR_ATmega2560__)
   // If play/stop button is pressed during boot, enter recording.
   
   {
  	 delay(20);
	 while(0 == PSKey);
	 delay(20);
        Record();
   }
  #endif
  }
}