Help in while, if & else

i am using rfid(id12 sparkfun) to start the functioning. then i have two button 5min, and 7min that will keep led on for given time along with that their is timer displaying on graphic lcd.
only one button is working at a time how can i add more buttons to it.

#include <SerialGraphicLCD.h>//inculde the Serial Graphic LCD library
#include <SoftwareSerial.h>
int RFIDResetPin = 13;
int FiveMinButtonPin = 4;
int SolenoidPin = 12;

//Register your RFID tags here
char tag1[13] = "650042F0D601";//registered 
char tag2[13] = "670072653242";//registered 

//LED Library
LCD LCD;

void setup(){
  //Setup RFID
  Serial.begin(9600);

  pinMode(RFIDResetPin, OUTPUT);
  digitalWrite(RFIDResetPin, HIGH);

  //ONLY NEEDED IF CONTROLING THESE PINS - EG. LEDs
  pinMode(12, OUTPUT);
  
  //Setup LED
  delay(1200);///wait for the one second spalsh screen before anything is sent to the LCD.
  LCD.setHome();//set the cursor back to 0,0.
  LCD.clearScreen();//clear anything that may have been previously printed ot the screen.
  delay(10);
  LCD.printStr("LED Initialized");
  delay(1500);
  LCD.clearScreen();
  //Setup Button
  pinMode(FiveMinButtonPin, INPUT_PULLUP); 
}

void loop(){

  char tagString[13];
  int index = 0;
  boolean reading = false;
  boolean bIdentified = false;
  boolean bFiveMinButtonPressed=false;
  long lTimeWhenIdentified;
  long lTimeInterval;

  while(Serial.available()){

    int readByte = Serial.read(); //read next available byte

    if(readByte == 2) reading = true; //begining of tag
    if(readByte == 3) reading = false; //end of tag

    if(reading && readByte != 2 && readByte != 10 && readByte != 13){
      //store the tag
      tagString[index] = readByte;
      index ++;
    }
  }

  
  bIdentified=checkTag(tagString); //Check if it is a match
  if(bIdentified==true)
  {
    bFiveMinButtonPressed=false;
    lTimeWhenIdentified=millis();
    lTimeInterval=0;
 
    LCD.setHome();
    LCD.clearScreen();
    delay(10);
    LCD.printStr("Waiting..");
    delay(10);
    while(lTimeInterval<(10*1000) && (bFiveMinButtonPressed==false))
    {
      lTimeInterval= millis()- lTimeWhenIdentified;
      if(digitalRead(FiveMinButtonPin)==false)
        bFiveMinButtonPressed=true;
    }
    if(bFiveMinButtonPressed==true)
    {
      LCD.setHome();
      LCD.clearScreen();
      delay(10);
      LCD.printStr("Welcome!");
        for(int i = 0; i<=4; i++)
  for(int x = 0; x<=6  ; x+=1)
  {
    LCD.printStr("Timer = ");
    LCD.printNum(i);
    LCD.printStr(":");
    LCD.printNum(x);
    //LCD.print;
    delay(1000);
    LCD.clearScreen();
      delay(10);
      lightLED(SolenoidPin); 
       for(int i = 0; i<=4; i++)
  for(int x = 0; x<=6  ; x+=1)
  {
    LCD.printStr("Timer = ");
    LCD.printNum(i);
    LCD.printStr(":");
    LCD.printNum(x);
    }}
    else
    {
      LCD.setHome();
      LCD.clearScreen();
      delay(10);
      LCD.printStr("Time out.");
      delay(10);
    }
    //Reset all flags
    bIdentified=false;
  }
  clearTag(tagString); //Clear the char of all value
  resetReader(); //eset the RFID reader
}

boolean checkTag(char tag[]){
///////////////////////////////////
//Check the read tag against known tags
///////////////////////////////////

  if(strlen(tag) == 0) 
    return false; //empty, no need to contunue

  if(compareTag(tag, tag1))
  { // if matched tag1, do this
    return true;
  }else if(compareTag(tag, tag2))
  { //if matched tag2, do this
    return true;
  }
  else
  {
    return false;
    Serial.println(tag); //read out any unknown tag
  }

}

void lightLED(int pin){
///////////////////////////////////
//Turn on LED on pin "pin" for 250ms
///////////////////////////////////
  Serial.println(pin);

  digitalWrite(pin, HIGH);
  delay(2000);
  digitalWrite(pin, LOW);
}

void resetReader(){
///////////////////////////////////
//Reset the RFID reader to read again.
///////////////////////////////////
  digitalWrite(RFIDResetPin, LOW);
  digitalWrite(RFIDResetPin, HIGH);
  delay(150);
}

void clearTag(char one[]){
///////////////////////////////////
//clear the char array by filling with null - ASCII 0
//Will think same tag has been read otherwise
///////////////////////////////////
  for(int i = 0; i < strlen(one); i++){
    one[i] = 0;
  }
}

boolean compareTag(char one[], char two[]){
///////////////////////////////////
//compare two value to see if same,
//strcmp not working 100% so we do this
///////////////////////////////////

  if(strlen(one) == 0) return false; //empty

  for(int i = 0; i < 12; i++){
    if(one[i] != two[i]) return false;
  }

  return true; //no mismatches
}

you need to put braces around every code block
this is always a bad idea.

This is not very good formatting and prone to errors;
I actually have no idea where you think the code blocks are

if(bFiveMinButtonPressed==true)
    {
      LCD.setHome();
      LCD.clearScreen();
      delay(10);
      LCD.printStr("Welcome!");
        for(int i = 0; i<=4; i++)
  for(int x = 0; x<=6  ; x+=1)
  {
    LCD.printStr("Timer = ");
    LCD.printNum(i);
    LCD.printStr(":");
    LCD.printNum(x);
    //LCD.print;
    delay(1000);
    LCD.clearScreen();
      delay(10);
      lightLED(SolenoidPin); 
       for(int i = 0; i<=4; i++)
  for(int x = 0; x<=6  ; x+=1)
  {
    LCD.printStr("Timer = ");
    LCD.printNum(i);
    LCD.printStr(":");
    LCD.printNum(x);
    }}
    else
    {

I think this is more what you mean…

   if(bFiveMinButtonPressed==true)
    {
		LCD.setHome();
		LCD.clearScreen();
		delay(10);
		LCD.printStr("Welcome!");

		for(int i = 0; i<=4; i++)
		{
			for(int x = 0; x<=6  ; x+=1)
			{
				LCD.printStr("Timer = ");
				LCD.printNum(i);
				LCD.printStr(":");
				LCD.printNum(x);
				//LCD.print;
				delay(1000);
				LCD.clearScreen();
				delay(10);
				lightLED(SolenoidPin); 
				  
				for(int i = 0; i<=4; i++)
				{
					for(int x = 0; x<=6  ; x+=1)
					{
						LCD.printStr("Timer = ");
						LCD.printNum(i);
						LCD.printStr(":");
						LCD.printNum(x);
					}
				}
			}
		}
	}
    else...

With your cursor in the Arduino source window, press Ctrl-T to automatically format your code. Always do that before you post your code...makes it much easier to read.

tejveer:
sorry man i am new to this its something like that
i want to ask is how to add other button to with different time.

Get rid of the delays. Look up the 'blink without delay' example in the IDE and Finite State Machine.

//LED Library
LCD LCD;

You can not have an instance of a class with the same name as the class. The LCD class is NOT defined in the LED library!

  while(Serial.available()){

    int readByte = Serial.read(); //read next available byte

    if(readByte == 2) reading = true; //begining of tag
    if(readByte == 3) reading = false; //end of tag

    if(reading && readByte != 2 && readByte != 10 && readByte != 13){
      //store the tag
      tagString[index] = readByte;
      index ++;
    }
  }

This will read the tag data as it sssllllooowwwlllyyy arrives. Many iterations of loop will happen before the reading is complete.

  char tagString[13];
  int index = 0;
  boolean reading = false;

This, done before the reading, will throw away most of the data for each tag. These variables should be global or static.

bIdentified=checkTag(tagString); //Check if it is a match

Does it seem reasonable to do this before you have a complete tag? Not to me.

  if(bIdentified==true)

Comparing true to true will return true. Comparing false to true will return false. The result of the comparison will be whatever is in bIdentified. The == true part is useless.

digitalRead() does not return true or false. Stop pretending it does.

                        for(int i = 0; i<=4; i++)

For statements should ALWAYS have curly braces. I know that that they are not always required. Use them anyway. Always!

Use Tools + Auto Format before posting poorly indented code again.

PaulS:
digitalRead() does not return true or false. Stop pretending it does.

Then what does it return?

Then what does it return?

I'm sure that you can find the reference page and see for yourself.

PaulS:

Then what does it return?

I'm sure that you can find the reference page and see for yourself.

That says it returns HIGH or LOW. If I Serial.print(digitalRead(pinX)); do I get the word HIGH or the word LOW appearing on the serial monitor screen or do I get a 1 or a 0?
Likewise, if I Serial.print a boolean variable, do I get the word true or the word false appearing on the serial monitor screen or do I get a 1 or a 0?

HIGH and LOW are concepts related to pin states.
true and false are concepts related to boolean variables/states.

While the VALUES are the same, the thought processes involved in using each are NOT. I do not like reading code written by people who can not think logically. To me, part of expressing that ability to think logically is not to interchange boolean states and pin states. Instead, make it clear that you KNOW that you are dealing with a pin state OR a boolean state. YMMV.

PaulS:
HIGH and LOW are concepts related to pin states.
true and false are concepts related to boolean variables/states.

While the VALUES are the same, the thought processes involved in using each are NOT. I do not like reading code written by people who can not think logically. To me, part of expressing that ability to think logically is not to interchange boolean states and pin states. Instead, make it clear that you KNOW that you are dealing with a pin state OR a boolean state. YMMV.

digitalRead(pinX) doesn't make it clear that you're reading the state of pinX????
My Arduino doesn't seem to know the difference between digital pin states and boolean/logic states.
Both are either 0 or !0.

Just because two constants happen to compare equal doesn't mean that that they are interchangeable. There are lots of constants and macro definitions that have the values 0 and 1, but that doesn't mean they're appropriate for testing the return value from digitalRead(). The following are all functionally equivalent but only the first one is right:

if(digitalRead(pin) == HIGH)
if(digitalRead(pin) == true)
if(digitalRead(pin) == OUTPUT)
if(digitalRead(pin) == DISPLAY)
if(digitalRead(pin) == CHANGE)
...

The following are all functionally equivalent but only the first one is right:

Actually, the issue is that they are all right. Only the first makes sense to me, and to you, apparently.

PeterH:
Just because two constants happen to compare equal doesn't mean that that they are interchangeable. There are lots of constants and macro definitions that have the values 0 and 1, but that doesn't mean they're appropriate for testing the return value from digitalRead(). The following are all functionally equivalent but only the first one is right:

if(digitalRead(pin) == HIGH)

if(digitalRead(pin) == true)
if(digitalRead(pin) == OUTPUT)
if(digitalRead(pin) == DISPLAY)
if(digitalRead(pin) == CHANGE)
...

How about? if(digitalRead(pin))which is what PaulS is complaining about.

I have to say that I'm with Henry_Best on this one. It might be because I'm coming at programming from a hardware basis, so I think that if(digitalRead(pin)) is perfectly reasonable to test for a Logic1 on a pin, as is if(!digitalRead(pin)) to test for a Logic0.

0b0 == FALSE == LOW and 0b1 == TRUE == HIGH

I also use lines above net labels with circles on pins for "low active" signals, and been witness to religious wars between the camps that want either or want both.

Henry_Best:
How about? if(digitalRead(pin))which is what PaulS is complaining about.

Same thing - you're relying on the value happening to equate to true. In specific situations where it does equate it will work, but it is very bad practice and no better than the other examples I showed - which hopefully you will agree are obviously a bad idea. Just because two constants happen to have the same value (today, in this environment) does not mean they can be used interchangeably.

Sembazuru:
I have to say that I'm with Henry_Best on this one.

Thanks.

It might be because I'm coming at programming from a hardware basis, so I think that if(digitalRead(pin)) is perfectly reasonable to test for a Logic1 on a pin, as is if(!digitalRead(pin)) to test for a Logic0.

I'm coming from an assembler/machine code basis where everything is 1 or 0.

0b0 == FALSE == LOW and 0b1 == TRUE == HIGH

Not quite, as anything !0 == true, so for example, -31429 == true.

Henry_Best:

Sembazuru:
0b0 == FALSE == LOW and 0b1 == TRUE == HIGH

Not quite, as anything !0 == true, so for example, -31429 == true.

You have me there, but only because the accumulator (and various other registers on any uP used on Arduinos) can't hold anything shorter than 8bits, where a single connection (from my hardware basis/bias) can only represent 1 bit at a time. (I was going to say a "wire", but it is conceivable to have a transmission line long enough with a signal fast enough that one could have several bits propagating down the line as AC...) Granted, at the opcode level of the HC908's that I've written assembler for (and I would presume other uPs) one can perform a conditional test on a single bit in only 1-2 clock cycles, which makes that type of bit investigation very attractive for optimized coding (both in clock cycles and memory usage).

I suppose I should have explicitly said my statement was at the bit level. I was hoping the bit quantity was implicit due to the lack of leading binary digits. :wink:
Any data structure larger than a single bit and yes, !0 == true.

Sembazuru:
You have me there, but only because the accumulator (and various other registers on any uP used on Arduinos) can't hold anything shorter than 8bits, where a single connection (from my hardware basis/bias) can only represent 1 bit at a time. (I was going to say a "wire", but it is conceivable to have a transmission line long enough with a signal fast enough that one could have several bits propagating down the line as AC...) Granted, at the opcode level of the HC908's that I've written assembler for (and I would presume other uPs) one can perform a conditional test on a single bit in only 1-2 clock cycles, which makes that type of bit investigation very attractive for optimized coding (both in clock cycles and memory usage).

I've no experience of the HC908. I programmed the Z80 in a Sinclair Spectrum.
The flag register is what I miss most, and yes "one can perform a conditional test on a single bit in only 1-2 clock cycles" on most uPs.
The disadvantage with Assembler/Machine Code is the time factor. Writing in C/C++ is much quicker and only slightly less flexible.

Henry_Best:

Sembazuru:
You have me there, but only because the accumulator (and various other registers on any uP used on Arduinos) can’t hold anything shorter than 8bits, where a single connection (from my hardware basis/bias) can only represent 1 bit at a time. (I was going to say a “wire”, but it is conceivable to have a transmission line long enough with a signal fast enough that one could have several bits propagating down the line as AC…) Granted, at the opcode level of the HC908’s that I’ve written assembler for (and I would presume other uPs) one can perform a conditional test on a single bit in only 1-2 clock cycles, which makes that type of bit investigation very attractive for optimized coding (both in clock cycles and memory usage).

I’ve no experience of the HC908. I programmed the Z80 in a Sinclair Spectrum.
The flag register is what I miss most, and yes “one can perform a conditional test on a single bit in only 1-2 clock cycles” on most uPs.
The disadvantage with Assembler/Machine Code is the time factor. Writing in C/C++ is much quicker and only slightly less flexible.

Yeah, early in my learning Arduino I wanted to use roll up and roll down, and was dismayed to not find it supported by C++… (As well as shift and conditional test based on carry… I ended up reading the bit that would be shifted out before the shift and then doing the conditional test.) So I guess I also miss the flag register because that is where the carry bit resides.

But, yeah. C/C++ is a bit easier except for a few corner cases.

So i finished it this is how it look

#include <SerialGraphicLCD.h>//inculde the Serial Graphic LCD library
#include <SoftwareSerial.h>
int RFIDResetPin = 13;
int FiveMinButtonPin = 4;
int SevenMinButtonPin = 5;
int TenMinButtonPin = 6;
int SolenoidPin = 12;
#define maxX 127//159 
#define maxY 50 //127

//Register your RFID tags here
char tag1[13] = "650042F0D601";//registered 
char tag2[13] = "670072653242";//registered 

//LED Library
LCD LCD;

void setup(){
  //Setup RFID
  Serial.begin(9600);

  pinMode(RFIDResetPin, OUTPUT);
  digitalWrite(RFIDResetPin, HIGH);

  //ONLY NEEDED IF CONTROLING THESE PINS - EG. LEDs
  pinMode(12, OUTPUT);

  //Setup LED
  delay(1200);///wait for the one second spalsh screen before anything is sent to the LCD.
  LCD.setHome();//set the cursor back to 0,0.
  LCD.clearScreen();//clear anything that may have been previously printed ot the screen.
  delay(10);
  LCD.printStr("Initialized");
  delay(1500);
  LCD.clearScreen();
  LCD.printStr("Tap RFID tag");
  delay(1000); 
  lineDemo();
  //Setup Button
  pinMode(FiveMinButtonPin, INPUT_PULLUP);
  pinMode(SevenMinButtonPin, INPUT_PULLUP);
  pinMode(TenMinButtonPin, INPUT_PULLUP); 
}

void loop(){


  char tagString[13];
  int index = 0;
  boolean reading = false;
  boolean bIdentified = false;
  boolean bFiveMinButtonPressed=false;
  boolean bSevenMinButtonPressed=false;
  boolean bTenMinButtonPressed=false;
  long lTimeWhenIdentified;
  long lTimeInterval;

  while(Serial.available()){

    int readByte = Serial.read(); //read next available byte

    if(readByte == 2) reading = true; //begining of tag
    if(readByte == 3) reading = false; //end of tag

    if(reading && readByte != 2 && readByte != 10 && readByte != 13){
      //store the tag
      tagString[index] = readByte;
      index ++;
    }
  }


  bIdentified=checkTag(tagString); //Check if it is a match
  if(bIdentified==true)
  {

    bTenMinButtonPressed=false;
    bSevenMinButtonPressed=false;
    bFiveMinButtonPressed=false;
    lTimeWhenIdentified=millis();
    lTimeInterval=0;

    LCD.setHome();
    LCD.clearScreen();
    delay(10);
    LCD.printStr("Waiting..");
    delay(10);

    LCD.printStr("            Press button to start");
    delay(1000);



    while(lTimeInterval<(15*1000) && (bFiveMinButtonPressed==false) && (bSevenMinButtonPressed==false) &&
      (bTenMinButtonPressed==false ))
    {
      lTimeInterval= millis()- lTimeWhenIdentified;
      if(digitalRead(FiveMinButtonPin)==false) 
        bFiveMinButtonPressed=true;
      else if(digitalRead(SevenMinButtonPin)==false) 
        bSevenMinButtonPressed=true;
      else if(digitalRead(TenMinButtonPin)==false)
        bTenMinButtonPressed=true;
      //bSevenMinButtonPressed=true;
    }

    if(bFiveMinButtonPressed==true)
    { 
      LCD.setHome();
      LCD.clearScreen();
      delay(10);
      LCD.printStr("Welcome! - 5min timer strating...");
      delay(1500);
      LCD.clearScreen();
      delay(10);
      digitalWrite(12, HIGH); 

      for(int i = 0; i<=4; i++)
        for(int x = 0; x<=2  ; x+=1)
        {
          LCD.printStr("Timer(5min) = ");
          LCD.printNum(i);
          LCD.printStr(":");
          LCD.printNum(x);
          //LCD.print;
          delay(1000);
          LCD.clearScreen();
          delay(10);

        }
      digitalWrite(12, LOW) ;
      LCD.clearScreen(); 
      LCD.printStr("Time UP              Wait five minutes to start again"); 
      delay(10000);
      LCD.clearScreen(); 
      LCD.printStr("Tap rfid To start"); 

    }
    else if(bSevenMinButtonPressed==true)
    { 
      LCD.setHome();
      LCD.clearScreen();
      delay(10);
      LCD.printStr("Welcome! - 7min timer strating...");
      delay(1500);
      LCD.clearScreen();
      delay(10);
      digitalWrite(12, HIGH); 

      for(int i = 0; i<=6; i++)
        for(int x = 0; x<=3 ; x+=1)
        {
          LCD.printStr("Timer(7min) = ");
          LCD.printNum(i);
          LCD.printStr(":");
          LCD.printNum(x);
          //LCD.print;
          delay(1000);
          LCD.clearScreen();
          delay(10);

        }
      digitalWrite(12, LOW) ;
      digitalWrite(12, LOW) ;
      LCD.clearScreen(); 
      LCD.printStr("Time UP              Wait five minutes to start again"); 
      delay(10000);
      LCD.clearScreen(); 
      LCD.printStr("Tap rfid To start Again"); 

    }
    else if(bTenMinButtonPressed==true)
    { 
      LCD.setHome();
      LCD.clearScreen();
      delay(10);
      LCD.printStr("Welcome! - 10min timer strating...");
      delay(1500);
      LCD.clearScreen();
      delay(10);
      digitalWrite(12, HIGH); 

      for(int i = 0; i<=9; i++)
        for(int x = 0; x<=3  ; x+=1)
        {
          LCD.printStr("Timer(10min) = ");
          LCD.printNum(i);
          LCD.printStr(":");
          LCD.printNum(x);
          //LCD.print;
          delay(1000);
          LCD.clearScreen();
          delay(10);

        }
      digitalWrite(12, LOW) ;
      digitalWrite(12, LOW) ;
      LCD.clearScreen(); 
      LCD.printStr("Time UP              Wait five minutes to start again"); 
      delay(10000);
      LCD.clearScreen(); 
      LCD.printStr("Tap rfid To start Again"); 

    }

    else
    {
      LCD.setHome();
      LCD.clearScreen();
      delay(10);
      LCD.printStr("Time out.        Tap again to start over");
      delay(10);
      boxDemo();
    }
    //Reset all flags
    bIdentified=false;
  }
  clearTag(tagString); //Clear the char of all value
  resetReader(); //eset the RFID reader
}

boolean checkTag(char tag[]){
  ///////////////////////////////////
  //Check the read tag against known tags
  ///////////////////////////////////

  if(strlen(tag) == 0) 
    return false; //empty, no need to contunue

    if(compareTag(tag, tag1))
  { // if matched tag1, do this
    return true;
  }
  else if(compareTag(tag, tag2))
  { //if matched tag2, do this
    return true;
  }
  else
  {
    return false;
    Serial.println(tag); //read out any unknown tag
  }

}

void lightLED(int pin){
  ///////////////////////////////////
  //Turn on LED on pin "pin" for 250ms
  ///////////////////////////////////
  Serial.println(pin);

  digitalWrite(pin, HIGH);
  delay(2000);
  digitalWrite(pin, LOW);
}

void resetReader(){
  ///////////////////////////////////
  //Reset the RFID reader to read again.
  ///////////////////////////////////
  digitalWrite(RFIDResetPin, LOW);
  digitalWrite(RFIDResetPin, HIGH);
  delay(150);
}

void clearTag(char one[]){
  ///////////////////////////////////
  //clear the char array by filling with null - ASCII 0
  //Will think same tag has been read otherwise
  ///////////////////////////////////
  for(int i = 0; i < strlen(one); i++){
    one[i] = 0;
  }
}

boolean compareTag(char one[], char two[]){
  ///////////////////////////////////
  //compare two value to see if same,
  //strcmp not working 100% so we do this
  ///////////////////////////////////

  if(strlen(one) == 0) return false; //empty

  for(int i = 0; i < 12; i++){
    if(one[i] != two[i]) return false;
  }

  return true; //no mismatches
}
void lineDemo()
{
  //This function demonstartes the drawLine() function. The parameters are (x1, y1, x2, y2, set).
  //Lines can be drawn from any point to any other point within the boundaries of the LCD. 
  LCD.clearScreen();
  LCD.setX((maxX/2)-30);
  LCD.setY(63);
  LCD.printStr("Tap RFID tag");
  delay(1500);
  //LCD.clearScreen();
  //draw x
  LCD.drawLine(0,0,maxX,maxY,1);//draw line from top left to bottom right
  delay(100);
  LCD.drawLine(0,maxY,maxX,0,1);//draw line from top left to bottom right
  delay(100);//draw box
  LCD.drawLine(0,0,maxX,0,1);//draw line from top left to top right
  delay(100);
  LCD.drawLine(0,maxY,maxX,maxY,1);//draw line from bottom left to bottom right
  delay(100);
  LCD.drawLine(0,0,0,maxY,1);//draw line from top left to bottom left
  delay(100);
  LCD.drawLine(maxX,0,maxX,maxY,1);//draw line from top right to bottom right
  delay(100);

}
void boxDemo()
{
  //This function demonstartes the drawBox() function. The parameters are (x1, y1, x2, y2, set).
  LCD.clearScreen();
  LCD.printStr("Time OUT Tap again");
  delay(1500);
  //LCD.clearScreen();

  LCD.drawBox(0,0,maxX,maxY,1);//draw box around entire display
  delay(1000);

  LCD.drawBox(10,10,(maxX - 10),(maxY - 10),1);//draw box around entire display
  delay(1000);

  LCD.drawBox(20,20,(maxX - 20),(maxY - 20),1);//draw box around entire display
  delay(1000);

  LCD.drawBox(30,30,(maxX - 30),(maxY - 30),1);//draw box around entire display
  delay(3000);
}