Switch Statement: Menu Printing Twice

Hey guys...new to using Arduino and looking for some help.

I am using a switch statement to drive a menu. One issue I am seeing is when I make a selection and the program subsequently "breaks" from the switch statement it prints out the menu twice on the serial monitor.

Can you help me understand why this is happening and what I can do to resolve it?

Thanks,

Tim

(deleted)

spycatcher2k:
You have an error on lines 4,23 and 65 of your sketch, I think! or possibly not, hard to tell without seeing it!

Here's the code:

//////////////PREPROCESSOR DIRECTIVES/////////

#include <Wire.h>

/////////////Function Prototypes//////////////

int menu();

/////////////GLOBAL VARIABLES////////////////

int SLAVEADDRESS = 0x08;
int REGISTERADDRESS = 0x1E;
int GATELOW = 0x00;
int GATEHIGH = 0x08;

////////////SETUP CONDITIONS/////////////////

void setup()
{

Wire.setClock(3400000);
Wire.beginTransmission(byte(SLAVEADDRESS));
Serial.begin(9600);

}

////////////MAIN FUNCTION///////////////////

void loop()
{

int const CLOCKGEN= 1,
BANDGAP = 2,
GPIO = 3,
VBUS_COMP = 4,
VAC_COMP = 5,
ISNS_COMP = 6,
TSENSE_COMP = 7,
QR_COMP = 8,
ADC_ = 9,
MS_DRIVER = 10,
AC_DRIVER = 11,
ACTIVE_CLAMP_FET = 12;

int mainChoice;

//Prints main menu to the serial monitor
Serial.println();
Serial.println();
Serial.println();
Serial.println("\t\t\t\t\t\t\t\t\t\t Select one of the following blocks to test: ");
Serial.println();
Serial.println();

Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t (1) CLOCKGEN");
Serial.println();

Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t (2) BANDGAP");
Serial.println();

Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t (3) GPIO");
Serial.println();

Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t (4) VBUS_COMP");
Serial.println();

Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t (5) VAC_COMP");
Serial.println();

Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t (6) ISNS_COMP");
Serial.println();

Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t (7) TSNS_COMP");
Serial.println();

Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t (8) QR_COMP");
Serial.println();

Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t (9) ADC");
Serial.println();

Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t (10) MS_DRIVER");
Serial.println();

Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t (11) AC_DRIVER");
Serial.println();

Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t (12) ACTIVE_CLAMP_FET");
Serial.println();
Serial.println();

//empty while loop to hold until user enters a menu choice
while(Serial.available()==0)
{}

mainChoice = Serial.parseInt();

switch (mainChoice)
{

case CLOCKGEN:
{
Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t CLOCKGEN is not built out yet");
}
break;

case BANDGAP:
{
Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t BANDGAP is not built out yet");
}
break;

case GPIO:
{
Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t GPIO is not built out yet");
}
break;

case VBUS_COMP:
{
Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t VBUS_COMP is not built out yet");
}
break;

case VAC_COMP:
{
Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t VAC_COMP is not built out yet");
}
break;

case ISNS_COMP:
{
Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t ISNS_COMP is not built out yet");
}
break;

case TSENSE_COMP:
{
Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t TSENSE_COMP is not built out yet");
}
break;

case QR_COMP:
{
Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t QR_COMP is not built out yet");
}
break;

case ADC_:
{
Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t ADC is not built out yet");
}
break;

case MS_DRIVER:
{
int msDriverChoice;

Serial.println();
Serial.println("\t\t\t\t\t\t\t\t\t\t\t ******************************");
Serial.println("\t\t\t\t\t\t\t\t\t\t\t ** MS DRIVER MENU **");
Serial.println("\t\t\t\t\t\t\t\t\t\t\t ******************************");
Serial.println();
Serial.println("\t\t\t\t\t\t\t\t\t\t Please enter your selection from the MS Driver menu below: ");
Serial.println();
Serial.println();
Serial.println("\t\t\t\t\t\t\t\t\t\t\t\t (1) MS VGATE HIGH ");
Serial.println("\t\t\t\t\t\t\t\t\t\t\t\t (2) MS VGATE LOW ");
Serial.println("\t\t\t\t\t\t\t\t\t\t\t\t (3) MS RPUP ");
Serial.println("\t\t\t\t\t\t\t\t\t\t\t\t (4) MS RPDN ");
Serial.println("\t\t\t\t\t\t\t\t\t\t\t\t (5) MS tRise ");
Serial.println("\t\t\t\t\t\t\t\t\t\t\t\t (6) MS tFall ");
Serial.println("\t\t\t\t\t\t\t\t\t\t\t\t (7) MS DRIVER PROP DELAY ");
Serial.println("\t\t\t\t\t\t\t\t\t\t\t\t (8) SW FREQ ");
Serial.println("\t\t\t\t\t\t\t\t\t\t\t\t (9) MS IQ 10V ACTIVE HIGH ");

while (Serial.available()==0){}

switch(msDriverChoice)
{

}
}
break;

case AC_DRIVER:
{
Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t AC_DRIVER is not built out yet");
}
break;

case ACTIVE_CLAMP_FET:
{
Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t ACTIVE_CLAMP is not built out yet");
}
break;
}

}

Please use code tags 8)

What is the line-ending set to in the Serial Monitor? Try changing it in the bottom-right corner.