void setup()
{
Serial.begin(9600); // Output to serial writing or BT
pinMode(led7Pin, OUTPUT); // initialize the led as a output control pin //
pinMode(led8Pin, OUTPUT); // initialize the led as a output control pin //
pinMode(led12Pin, OUTPUT); // initialize the led as a output control pin //
pinMode(led13Pin, OUTPUT); // initialize the led as a output control pin //
//pinMode(11,INPUT); //for calibration push button
//digitalWrite(11, HIGH); // enable the 20k internal pullup for MEGA board
digitalWrite((54), HIGH); // enable the 20k internal pullup for MEGA board
// lots of code
I'd try to drive the pins to a known state at the beginning of setup().