Switching in case message is not received

Hi everyone…
Am a new member in arduino world and would like to seek some assistance.
I want to write a code whereby when i send ON to gsm the red LED lights and when no message is received within 1minute, Green LED lights up… I’v managed the first part of lighting ON Red LED after sending a text, i dont know how to go about the second part

#include <GSM. h>
#define PINNUMBER ""
GSM gsmAccess; 
GSM_SMS sms; 
int REDLED=12;
int GRELED=11;

void setup()
{
pinMode (REDLED, OUTPUT);
pinMode (GRELED, OUTPUT);
Serial.begin(9600);
Serial.println("AT+CMGF=1\r");
delay(200);
Serial.println("AT+CMGD=1\r");
delay(200);
while (!serial) {
}
serial.println ("sms messages sender");
boolean notConnected = true; 

while (notConnected) {
if(gsmAccess.begin(PINNUMBER) == GSM_READY) {
notConnected = false;
} else {
serial. println("Not connected");
delay(1000);
}
}
Serial.println("GSM initialized");
delay(1000);
}

void loop()
{
char c; 
char smsData[80];
byt smsIndex=0;
if (sms.available());
{
Serial.println("message received");
sms.remoteNumber(senderNumber,20);
Serial.println(senderNumber);
while (c=sms.read())
{
Serial.print(c);
smsData[smsIndex++]=c; 
smsData[smsIndex]='\0';
if (strcmp(smsData,"ON")==0)
{
digitalWrite (REDLED, HIGH); 
}
}

Kindly help complete the above code so that it can light up the green LED when message is not received within 1minute…
Thank you

Milgo:
Kindly help complete the above code so that it can light up the green LED when message is not received within 1minute…
Thank you

Have I missed something? When did this forum become a code writing service?

To help anybody that may choose to help you, please post the error messages you receive when trying to compile this. I can see several already.

Am not receiving any error for this. Was just requesting for assistance on how to light up the other LED in case gsm does not receive the ON text in 1minute

Milgo:
Was just requesting for assistance on how

No you asked for someone to complete the code. There is a big difference between write my code and help me write. The latter involves you writing and is helping you fix what you do wrong. But it starts with you.

What you need is a variable to hold the time from millis when the last message was received. Then on each run through loop check to see if the current time exceeds that by some amount and take action if it does. See the famous Blink Without Delay example for more info on how to use millis.