i can't get the timer to work in the lcd shield sub menu

i can’t get the timer to work in the lcd shield sub menu

void menuItem1() { // Function executes when you select the 2nd item from main menu

int activeButton = 0;
int S = 59; // count seconds
int M = 59; // count minutes
int H = 11; // count hours

lcd.clear();
lcd.setCursor(0, 1);
drawInstructions();
lcd.setCursor(0, 0);
lcd.print(“NEXT FEED”);
lcd.setCursor(6, 1);
lcd.print(":");
lcd.setCursor(9, 1);
lcd.print(":");

S–;
delay(1000);

if(S<0)
{
M–;
S=59;
}
if(M<0)
{
H–;
M=59;
}
if(H<0)
{
H=23;
M=59;
S=59;
}
if(M>9)
{
lcd.setCursor(7,1);
lcd.print(M);
}
else
{
lcd.setCursor(7,1);
lcd.print(“0”);
lcd.setCursor(8,1);
lcd.print(M);
lcd.setCursor(9,1);
lcd.print(":");
}

if(S>9)
{
lcd.setCursor(10,1);
lcd.print(S);
}
else
{
lcd.setCursor(10,1);
lcd.print(“0”);
lcd.setCursor(11,1);
lcd.print(S);
lcd.setCursor(12,1);
lcd.print(" ");
}

if(H>9)
{
lcd.setCursor(4,1);
lcd.print (H);
}
else
{
lcd.setCursor(4,1);
lcd.print(“0”);
lcd.setCursor(5,1);
lcd.print(H);
lcd.setCursor(6,1);
lcd.print(":");
}

Your code doesn't compile.

Please remember to use code tags when posting code.

#include <LiquidCrystal.h>

int S = 59; // count seconds
int M = 59; // count minutes
int H = 11; // count hours
//initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); // pins connected to LCD

void setup()
{
lcd.begin(16,2);//set up the LCD’s number of columns and rows
}
void loop()
{
lcd.setCursor(1,0);
lcd.print (“Next Feed In”);
lcd.setCursor(6,1);
lcd.print(":");
lcd.setCursor(9,1);
lcd.print(":");

S–;
delay(1000);

if(S<0)
{
M–;
S=59;
}
if(M<0)
{
H–;
M=59;
}
if(H<0)
{
H=23;
M=59;
S=59;
}
if(M>9)
{
lcd.setCursor(7,1);
lcd.print(M);
}
else
{
lcd.setCursor(7,1);
lcd.print(“0”);
lcd.setCursor(8,1);
lcd.print(M);
lcd.setCursor(9,1);
lcd.print(":");
}

if(S>9)
{
lcd.setCursor(10,1);
lcd.print(S);
}
else
{
lcd.setCursor(10,1);
lcd.print(“0”);
lcd.setCursor(11,1);
lcd.print(S);
lcd.setCursor(12,1);
lcd.print(" ");
}

if(H>9)
{
lcd.setCursor(4,1);
lcd.print (H);
}
else
{
lcd.setCursor(4,1);
lcd.print(“0”);
lcd.setCursor(5,1);
lcd.print(H);
lcd.setCursor(6,1);
lcd.print(":");
}
}

F521I0MIPET1CCA.ino (14 KB)

The code in your attachment is completely different from the code in your Post. And the code in your Post is almost unreadable.

I don’t understand what you want to do.

To make it easy for people to help you please modify your post and use the code button </> so your code looks like this and is easy to copy to a text editor. See How to use the Forum

Also please use the AutoFormat tool to indent your code for easier reading.

…R

And please don't waste our time (and yours) by double posting

...R