void pmode(){
if(once1 == 0){
   once1 = 1;
  goto here;//run menu once to print to display
}

if (digitalRead(setbup) == 0){
here://used to initialize the menu when settings first called
delay(200);
ia = ia+1;//counterincrements for scrolling selections
ib = ib+1;
ic = ic+1; 
id = id+1; 
ie = ie+1;

if (ia>4){ia=0;}//used to loop the counter 
if (ib>4){ib=0;}
if (ic>4){ic=0;}
if (id>4){id=0;}
if (ie>4){ie=0;}


 TCA9548A(2);
  mainDisplay.clearDisplay();
  mainDisplay.setTextSize(2);
  mainDisplay.setTextColor(WHITE);
  mainDisplay.setCursor(1,1);
  mainDisplay.print(edits[ia]);//counter states are used to create scroll up of choises
  mainDisplay.setTextSize(1);
  mainDisplay.setCursor(15,19);
  mainDisplay.print(edits[ib]);//counter state
  mainDisplay.setCursor(15,27);
  mainDisplay.print(edits[ic]);//TARGET for next menu
  mainDisplay.setCursor(15,37);
  mainDisplay.print(edits[id]);
  mainDisplay.setCursor(15,47);
  mainDisplay.print(edits[ie]);
  mainDisplay.setCursor(15,57);
  mainDisplay.display();

}//end if

if (digitalRead(setbdown) == 0){
delay(200);
ia = ia-1;//counterincrements for scrolling selections
ib = ib-1;
ic = ic-1; 
id = id-1; 
ie = ie-1;

if (ia<0){ia=4;}//used to stop overflow
if (ib<0){ib=4;}
if (ic<0){ic=4;}
if (id<0){id=4;}
if (ie<0){ie=4;}

 TCA9548A(2);
  mainDisplay.clearDisplay();//counter states are used to create scroll up of choises
  mainDisplay.setTextSize(2);
  mainDisplay.setTextColor(WHITE);
  mainDisplay.setCursor(1,1);
  mainDisplay.print(edits[ia]);//TARGET for next menu
  mainDisplay.setTextSize(1);
  mainDisplay.setCursor(15,19);
  mainDisplay.print(edits[ib]);//counter state
  mainDisplay.setTextSize(1);
  mainDisplay.setCursor(15,27);
  mainDisplay.print(edits[ic]);
  mainDisplay.setTextSize(1);
  mainDisplay.setCursor(15,37);
  mainDisplay.print(edits[id]);
  mainDisplay.setCursor(15,47);
  mainDisplay.print(edits[ie]);

  mainDisplay.display();


}//end if


if (digitalRead(setbleft) == 0){
  mainDisplay.clearDisplay();
  mainDisplay.setTextSize(2);
  mainDisplay.setTextColor(WHITE);
  mainDisplay.setCursor(5,30);
  mainDisplay.print("EXITING");
  mainDisplay.display();
  delay(800);
  mainDisplay.clearDisplay();
  mainDisplay.setTextSize(1);
  mainDisplay.setCursor(15,2);
  mainDisplay.print("DESIGNERTRONICS");
     mainDisplay.display();
     once1 = 0; 
  return;
}
 
if (digitalRead(setbright) == 0){//executes menu selection
delay(200);
 switch (ia){//performs task of menu selection

case 0://default
 
    mainDisplay.clearDisplay();
  mainDisplay.setTextSize(2);
  mainDisplay.setTextColor(WHITE);
  mainDisplay.setCursor(5,30);
  mainDisplay.print("EXITING");
  mainDisplay.display();
  delay(800);
  mainDisplay.clearDisplay();
  mainDisplay.setTextSize(1);
  mainDisplay.setCursor(15,2);
  mainDisplay.print("DESIGNERTRONICS");
     mainDisplay.display();
     once1 = 0; 
  return;
     break;   
 
case 1://bluetooth
   
once1 = 0;
startBT();
 return;
    break; 

case 2://edit lists

   TCA9548A(2);
  mainDisplay.clearDisplay();
  mainDisplay.setTextSize(2);
  mainDisplay.setTextColor(WHITE);
  mainDisplay.setCursor(5,30);
  mainDisplay.print("WIFI EDIT");
  mainDisplay.display();
  delay(800);
  once1 = 0;
 startWeb();
 return;
    break;    
 
case 3://save setting to flash
   
   TCA9548A(2);
  mainDisplay.clearDisplay();
  mainDisplay.setTextSize(2);
  mainDisplay.setTextColor(WHITE);
  mainDisplay.setCursor(5,30);
  mainDisplay.print("SAVE FLASH");
  mainDisplay.display();
  delay(100);
   once1 = 0;
  saveToFlash();
    break;    

case 4://exit
 
   TCA9548A(2);
  mainDisplay.clearDisplay();
  mainDisplay.setTextSize(2);
  mainDisplay.setTextColor(WHITE);
  mainDisplay.setCursor(5,30);
  mainDisplay.print("DEFAULT");
  mainDisplay.display();
  delay(100);
   once1 = 0;
setDefaults();
    break;        
    
}//endswitch
}//endif

if(once1 == 1){
   pmode();
}
return;
}