 
   boolean offMode = initialise_boolean_select();  
 
-
   lcd.clear();
   lcd.setCursor(0, 0);
   lcd.print("Select");

  digitalWrite(BZ_OU_PIN, HIGH);
}


void initialise_eeprom() 
{
  /*
  eeprom_write(0, first);
  eeprom_write(0, second);
  eeprom_write(magic_number, magic);
  */
}


boolean initialise_boolean_select()
{
  decode_results results;


  int channelGap = initialise_number_select(1, 5, 1, 1);  

  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Select timer");
  lcd.setCursor(0, 1);  
  lcd.print("for TV auto off");

  irrecv.resume();
  while(irrecv.decode(&results) != 1 ) { } 

  lcd.clear(); 
  lcd.setCursor(0, 0);
  lcd.print("ON : change no");
  lcd.setCursor(0, 1);
  lcd.print("OFF: done");  

  int tvOnTime = initialise_number_select(30, 120, 50, 5);  

  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Select timer");
  lcd.setCursor(0, 1);  
  lcd.print("for TV auto on");

  irrecv.resume();
  while(irrecv.decode(&results) != 1 ) { } 

  lcd.clear(); 
  lcd.setCursor(0, 0);
  lcd.print("ON : change no");
  lcd.setCursor(0, 1);
  lcd.print("OFF: done");  

  int tvOffTime = initialise_number_select(5, 20, 10, 5);  

  //
  boolean initialise_eeprom_done =  initialise_eeprom(pwrSrc, wrkMode, startMode, beepMode, offMode, channelGap, tvOnTime, tvOffTime) 

  while(initialise_eeprom_done != 1 ) { } 

  lcd.clear(); 
  lcd.setCursor(0, 0);
  lcd.print("Setup is done");
  lcd.setCursor(0, 1);
  if ( setUpStatus == 0 ) {
      lcd.print("change setup sw");
  }

  irrecv.resume();
  while(irrecv.decode(&results) != 1 ) { } 

  lcd.clear(); 
  lcd.setCursor(0, 0);
  lcd.print("Press any button");
  lcd.setCursor(0, 1);
  lcd.print("to reset");

  irrecv.resume();
  while(irrecv.decode(&results) != 1 ) { }       

  resetFunc(); 

}


boolean initialise_eeprom(boolean i_pwrSrc, boolean i_wrkMode, boolean i_startMode, boolean i_beepMode, boolean i_offMode, int i_channelGap, int i_tvOnTime, int i_tvOffTime) 
{
  eeprom_write(i_pwrSrc, pwrSrc);
  eeprom_write(i_wrkMode, wrkMode);
  eeprom_write(i_startMode, startMode);
  eeprom_write(i_beepMode, beepMode);
  eeprom_write(i_offMode, offMode);
  eeprom_write(i_channelGap, channelGap);
  eeprom_write(i_tvOnTime, tvOnTime);
  eeprom_write(i_tvOffTime, tvOffTime);
  eeprom_write(magic_number, magic);

  return 1;
}

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

