Motor controller and LCD display code help.

Hello,

I’m working on a project that will run a motor and display some information on a 16x2 LCD. the motor is a linear actuator the operates off of 12V so I purchased SEED motor controller shield and LCD shield from robotsheild.com.
I’ve Written the code that runs the motor but it runs infinitely, so I would like for it to be triggered by either a button or a sensor but don’t know how I would do it. In addition I need to include a counter to track the number of cycles that the motor runs through, then display that number and some text.
A problem I also have run into is the two shields have overlapping used pins. I don’t see a way around it so I will probably have to purchase a arduino mega.

this is where I am currently.

#include <LiquidCrystal.h>
#include “MotorDriver.h”

void setup()
{

motordriver.init();
motordriver.setSpeed(200,MOTORB);
}

void loop()
{

// if(digitalRead(buttonPin) == LOW) //functions based off of button pulling input pin LOW
// {

motordriver.goForward();
delay(6350);
motordriver.stop();
delay(1000);
motordriver.goBackward();
delay(6350);
motordriver.stop();
delay(1000);
// }

}

Any help, whether just pointers or and overall walk through, would be appreciated greatly.
Thanks!