Help on error codes

I'm experimenting with a very nice Countdown timer code which I found on http://arduinoideas.webeden.co.uk/#/lcd-8/4568119394 (please have a look at it), and when I verify it it gives me the following error codes:

sketch_may22e.ino: In function 'void loop()': sketch_may22e:48: error: invalid conversion from 'int' to 'const char*' sketch_may22e:48: error: initializing argument 1 of 'String& String::operator=(const char*)' sketch_may22e:49: error: invalid conversion from 'int' to 'const char*' sketch_may22e:49: error: initializing argument 1 of 'String& String::operator=(const char*)' sketch_may22e:50: error: invalid conversion from 'int' to 'const char*' sketch_may22e:50: error: initializing argument 1 of 'String& String::operator=(const char*)'

Can anybody help please, in solving this problem because I'm lost in all of these. Thank you

Auto-format works wonders:

#include <LiquidCrystal.h> // import the library
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);// data and control lines
String adjusts[]={
  "      iDeas"," Adjust seconds"," Adjust minutes","  Adjust hours"};// set text  values for adjust menu
int adjustmode=0; // the track of the adjust menu
int hour=0; // the count of hours upon which we can make the mathematical operations
int minute=0; // the count of minutes upon which we can make the mathematical operations
int second=0;// the count of seconds upon which we can make the mathematical operations
String hourstring="";//the output variable component for hours
String minutestring="";//the output variable component for minutes
String secondstring="";//the output variable component for seconds
long timethen=0;//the variable to hold a sample of the time in seconds
boolean runbutton=false; //the variable to control the run button
boolean alarmon=false;// the switch for the alarm
boolean pause=false;// the track for the pause
void setup(){
  lcd.begin(16,2);//start the LCD module
  lcd.clear();//clear down residual text
  lcd.print(adjusts[0]);//printout start screen
}
void loop(){
  int timezero=hour+minute+second ;
  if (runbutton==false&&adjustmode==0&&digitalRead(6)==HIGH&&timezero>0){
    runbutton=true;
    timethen=millis();
  }//sets condition for running the timer on buttonpress and samples time
  if (runbutton==false&&digitalRead(7)==HIGH&&alarmon==false){//starts loop if not running countdown and adjust button has been pressed
    lcd.setCursor(0,0);
    lcd.print("                ");//clears top line of module
    adjustmode++;
    if(adjustmode==4){
      adjustmode=0;
    }//increment variable and reset at 4
    lcd.setCursor(0,0);
    lcd.print(adjusts[adjustmode]);// set to top line and print out what to adjust
    delay(500);//wait for half a second
  }
  if(runbutton==false&&adjustmode==1&&digitalRead(8)==HIGH){
    second++;
    delay(500);
    if(second==60){
      second=0;
    }
  } //increment seconds by 1
  if(runbutton==false&&adjustmode==1&&digitalRead(9)==HIGH){
    second--;
    delay(500);
    if(second==-1){
      second=59;
    }
  } //decrement seconds by 1
  if(runbutton==false&&adjustmode==2&&digitalRead(8)==HIGH){
    minute++;
    delay(500);
    if(minute==60){
      minute=0;
    }
  } //increment minutes by 1
  if(runbutton==false&&adjustmode==2&&digitalRead(9)==HIGH){
    minute--;
    delay(500);
    if(minute==-1){
      minute=59;
    }
  } //decrement minutes by 1
  if(runbutton==false&&adjustmode==3&&digitalRead(8)==HIGH){
    hour++;
    delay(500);
    if(hour==60){
      hour=0;
    }
  } //increment hours by 1
  if(runbutton==false&&adjustmode==3&&digitalRead(9)==HIGH){
    hour--;
    delay(500);
    if(hour==-1){
      hour=59;
    }
  } //decrement hours by 1
  if (runbutton==true&&pause==false&&digitalRead(7)==HIGH){
    pause=true;
    delay(1000);
    timethen=timethen+1000;
  }//switch pause on
  if (runbutton==true&&pause==true&&digitalRead(7)==HIGH){
    pause=false;
    delay(1000);
    timethen=timethen+1000;
  }//switch pause off
  if (runbutton==true&&digitalRead(8)==HIGH){
    hour=0;
    minute=0;
    second=0;
    runbutton=false;
  }//clears the countdown and resets to zero
  if (pause==true){
    timethen=millis();
  }//track time in pause mode
  if(runbutton==true&&pause==false){// ** all the lines following marked with //** are active only when running
    if (millis()-timethen>=1000){
      timethen=millis();
      second=second-1;
      tone(10,50,10);
    }//**as a second passes drop down seconds and make tick sound
    if (second==-1) {
      second=59;
      minute=minute-1;
    }//**as a minute passes drop down minutes
    if (minute==-1) {
      minute=59;
      hour=hour-1;
    }//**as an hour passes drop down hours
    if(hour==-1){
      hour=0;
    }//**reset hours to 0

  }

  if (runbutton==true&&hour==0&&minute==0&&second==0){
    alarmon=true;
    runbutton=false;
  }// set conditions for end of run(time remaining is zero)
  if (hour<10){
    hourstring="0";
    hourstring=hourstring+hour;
  }
  else {
    hourstring=hour;
  }//setup for hour output
  if (minute<10){
    minutestring="0";
    minutestring=minutestring+minute;
  }
  else {
    minutestring=minute;
  }//setup for minute output
  if (second<10){
    secondstring="0";
    secondstring=secondstring+second;
  }
  else {
    secondstring=second;
  }//setup for second output
  String outstring=hourstring+":"+minutestring+":"+secondstring;//compound string for output
  lcd.setCursor(4,1);
  lcd.print(outstring);//set position and print compound string
  if (alarmon==true){// activates at end of run time
    tone(10,444,10);//outputs tone
    if (digitalRead(6)==HIGH){
      alarmon=false;
      pause=false;
    }
  }//switches off tone when run button is pressed
}

“Handy REM statements” ?

AWOL:
Auto-format works wonders:

#include <LiquidCrystal.h> // import the library

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);// data and control lines
String adjusts={
  "      iDeas"," Adjust seconds"," Adjust minutes","  Adjust hours"};// set text  values for adjust menu
int adjustmode=0; // the track of the adjust menu
int hour=0; // the count of hours upon which we can make the mathematical operations
int minute=0; // the count of minutes upon which we can make the mathematical operations
int second=0;// the count of seconds upon which we can make the mathematical operations
String hourstring="";//the output variable component for hours
String minutestring="";//the output variable component for minutes
String secondstring="";//the output variable component for seconds
long timethen=0;//the variable to hold a sample of the time in seconds
boolean runbutton=false; //the variable to control the run button
boolean alarmon=false;// the switch for the alarm
boolean pause=false;// the track for the pause
void setup(){
  lcd.begin(16,2);//start the LCD module
  lcd.clear();//clear down residual text
  lcd.print(adjusts[0]);//printout start screen
}
void loop(){
  int timezero=hour+minute+second ;
  if (runbutton==false&&adjustmode==0&&digitalRead(6)==HIGH&&timezero>0){
    runbutton=true;
    timethen=millis();
  }//sets condition for running the timer on buttonpress and samples time
  if (runbutton==false&&digitalRead(7)==HIGH&&alarmon==false){//starts loop if not running countdown and adjust button has been pressed
    lcd.setCursor(0,0);
    lcd.print("                ");//clears top line of module
    adjustmode++;
    if(adjustmode==4){
      adjustmode=0;
    }//increment variable and reset at 4
    lcd.setCursor(0,0);
    lcd.print(adjusts[adjustmode]);// set to top line and print out what to adjust
    delay(500);//wait for half a second
  }
  if(runbutton==false&&adjustmode==1&&digitalRead(8)==HIGH){
    second++;
    delay(500);
    if(second==60){
      second=0;
    }
  } //increment seconds by 1
  if(runbutton==false&&adjustmode==1&&digitalRead(9)==HIGH){
    second–;
    delay(500);
    if(second==-1){
      second=59;
    }
  } //decrement seconds by 1
  if(runbutton==false&&adjustmode==2&&digitalRead(8)==HIGH){
    minute++;
    delay(500);
    if(minute==60){
      minute=0;
    }
  } //increment minutes by 1
  if(runbutton==false&&adjustmode==2&&digitalRead(9)==HIGH){
    minute–;
    delay(500);
    if(minute==-1){
      minute=59;
    }
  } //decrement minutes by 1
  if(runbutton==false&&adjustmode==3&&digitalRead(8)==HIGH){
    hour++;
    delay(500);
    if(hour==60){
      hour=0;
    }
  } //increment hours by 1
  if(runbutton==false&&adjustmode==3&&digitalRead(9)==HIGH){
    hour–;
    delay(500);
    if(hour==-1){
      hour=59;
    }
  } //decrement hours by 1
  if (runbutton==true&&pause==false&&digitalRead(7)==HIGH){
    pause=true;
    delay(1000);
    timethen=timethen+1000;
  }//switch pause on
  if (runbutton==true&&pause==true&&digitalRead(7)==HIGH){
    pause=false;
    delay(1000);
    timethen=timethen+1000;
  }//switch pause off
  if (runbutton==true&&digitalRead(8)==HIGH){
    hour=0;
    minute=0;
    second=0;
    runbutton=false;
  }//clears the countdown and resets to zero
  if (pause==true){
    timethen=millis();
  }//track time in pause mode
  if(runbutton==true&&pause==false){// ** all the lines following marked with //** are active only when running
    if (millis()-timethen>=1000){
      timethen=millis();
      second=second-1;
      tone(10,50,10);
    }//**as a second passes drop down seconds and make tick sound
    if (second==-1) {
      second=59;
      minute=minute-1;
    }//**as a minute passes drop down minutes
    if (minute==-1) {
      minute=59;
      hour=hour-1;
    }//**as an hour passes drop down hours
    if(hour==-1){
      hour=0;
    }//**reset hours to 0

}

if (runbutton==true&&hour==0&&minute==0&&second==0){
    alarmon=true;
    runbutton=false;
  }// set conditions for end of run(time remaining is zero)
  if (hour<10){
    hourstring=“0”;
    hourstring=hourstring+hour;
  }
  else {
    hourstring=hour;
  }//setup for hour output
  if (minute<10){
    minutestring=“0”;
    minutestring=minutestring+minute;
  }
  else {
    minutestring=minute;
  }//setup for minute output
  if (second<10){
    secondstring=“0”;
    secondstring=secondstring+second;
  }
  else {
    secondstring=second;
  }//setup for second output
  String outstring=hourstring+":"+minutestring+":"+secondstring;//compound string for output
  lcd.setCursor(4,1);
  lcd.print(outstring);//set position and print compound string
  if (alarmon==true){// activates at end of run time
    tone(10,444,10);//outputs tone
    if (digitalRead(6)==HIGH){
      alarmon=false;
      pause=false;
    }
  }//switches off tone when run button is pressed
}




"Handy REM statements" ?

Which means?

Thank you but I still get error codes!!!

I just assumed s/he was lost in BASIC. :D I posted the code because you hadn't, and I auto-formatted it because the author hadn't.

Can you help me a bit more please because I still get error codes?

I don’t use String for well-documented reasons (and I’m really old), but does   hourstring = String(hour);
help at all?

I'm Afraid not. It is getting too complicated and I'm still new at this

The fix I gave you (and another similar couple of instances of the same) fixed it for me. Well, it compiled - beyond that, I'm not interested - I don't have your hardware (actually, I don't even have an Arduino)

What errors are you getting now? Post [u]your[/u] code

I'm sorry maybe I'm doing something wrong. Can you please give me the code as you fixed it? I have to finish a project and I'm running out of time.

#include <LiquidCrystal.h> // import the library
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);// data and control lines
String adjusts[]={
  "      iDeas"," Adjust seconds"," Adjust minutes","  Adjust hours"};// set text  values for adjust menu
int adjustmode=0; // the track of the adjust menu
int hour=0; // the count of hours upon which we can make the mathematical operations
int minute=0; // the count of minutes upon which we can make the mathematical operations
int second=0;// the count of seconds upon which we can make the mathematical operations
String hourstring="";//the output variable component for hours
String minutestring="";//the output variable component for minutes
String secondstring="";//the output variable component for seconds
long timethen=0;//the variable to hold a sample of the time in seconds
boolean runbutton=false; //the variable to control the run button
boolean alarmon=false;// the switch for the alarm
boolean pause=false;// the track for the pause
void setup(){
  lcd.begin(16,2);//start the LCD module
  lcd.clear();//clear down residual text
  lcd.print(adjusts[0]);//printout start screen
}
void loop(){
  int timezero=hour+minute+second ;
  if (runbutton==false&&adjustmode==0&&digitalRead(6)==HIGH&&timezero>0){
    runbutton=true;
    timethen=millis();
  }//sets condition for running the timer on buttonpress and samples time
  if (runbutton==false&&digitalRead(7)==HIGH&&alarmon==false){//starts loop if not running countdown and adjust button has been pressed
    lcd.setCursor(0,0);
    lcd.print("                ");//clears top line of module
    adjustmode++;
    if(adjustmode==4){
      adjustmode=0;
    }//increment variable and reset at 4
    lcd.setCursor(0,0);
    lcd.print(adjusts[adjustmode]);// set to top line and print out what to adjust
    delay(500);//wait for half a second
  }
  if(runbutton==false&&adjustmode==1&&digitalRead(8)==HIGH){
    second++;
    delay(500);
    if(second==60){
      second=0;
    }
  } //increment seconds by 1
  if(runbutton==false&&adjustmode==1&&digitalRead(9)==HIGH){
    second--;
    delay(500);
    if(second==-1){
      second=59;
    }
  } //decrement seconds by 1
  if(runbutton==false&&adjustmode==2&&digitalRead(8)==HIGH){
    minute++;
    delay(500);
    if(minute==60){
      minute=0;
    }
  } //increment minutes by 1
  if(runbutton==false&&adjustmode==2&&digitalRead(9)==HIGH){
    minute--;
    delay(500);
    if(minute==-1){
      minute=59;
    }
  } //decrement minutes by 1
  if(runbutton==false&&adjustmode==3&&digitalRead(8)==HIGH){
    hour++;
    delay(500);
    if(hour==60){
      hour=0;
    }
  } //increment hours by 1
  if(runbutton==false&&adjustmode==3&&digitalRead(9)==HIGH){
    hour--;
    delay(500);
    if(hour==-1){
      hour=59;
    }
  } //decrement hours by 1
  if (runbutton==true&&pause==false&&digitalRead(7)==HIGH){
    pause=true;
    delay(1000);
    timethen=timethen+1000;
  }//switch pause on
  if (runbutton==true&&pause==true&&digitalRead(7)==HIGH){
    pause=false;
    delay(1000);
    timethen=timethen+1000;
  }//switch pause off
  if (runbutton==true&&digitalRead(8)==HIGH){
    hour=0;
    minute=0;
    second=0;
    runbutton=false;
  }//clears the countdown and resets to zero
  if (pause==true){
    timethen=millis();
  }//track time in pause mode
  if(runbutton==true&&pause==false){// ** all the lines following marked with //** are active only when running
    if (millis()-timethen>=1000){
      timethen=millis();
      second=second-1;
      tone(10,50,10);
    }//**as a second passes drop down seconds and make tick sound
    if (second==-1) {
      second=59;
      minute=minute-1;
    }//**as a minute passes drop down minutes
    if (minute==-1) {
      minute=59;
      hour=hour-1;
    }//**as an hour passes drop down hours
    if(hour==-1){
      hour=0;
    }//**reset hours to 0

  }

  if (runbutton==true&&hour==0&&minute==0&&second==0){
    alarmon=true;
    runbutton=false;
  }// set conditions for end of run(time remaining is zero)
  if (hour<10){
    hourstring="0";
    hourstring=hourstring+hour;
  }
  else {
    hourstring=String(hour);  // <<< I FIXED THIS LINE
  }//setup for hour output
  if (minute<10){
    minutestring="0";
    minutestring=minutestring+minute;
  }
  else {
    minutestring=minute;  // << You can fix this one
  }//setup for minute output
  if (second<10){
    secondstring="0";
    secondstring=secondstring+second;
  }
  else {
    secondstring=second;  // << you can fix this one
  }//setup for second output
  String outstring=hourstring+":"+minutestring+":"+secondstring;//compound string for output
  lcd.setCursor(4,1);
  lcd.print(outstring);//set position and print compound string
  if (alarmon==true){// activates at end of run time
    tone(10,444,10);//outputs tone
    if (digitalRead(6)==HIGH){
      alarmon=false;
      pause=false;
    }
  }//switches off tone when run button is pressed
}

Don’t forget to tell us your grade.

Great, it compiled. I will try to make a few changes more and I will let you know. Thanks a lot. Regards