RFID treasure hunt game

Here’s my project for the Great Create through Radioshack. It’s an RFID treasure hunt game. It uses Newserialsoft, liquidcrystal and button libraries. I’ll be posting a youtube video shortly. The code is below. The clues are cheesy,they are just there for filler. Enjoy!

// RFID Treasure hunt game by DerekD based on
// RFID reader for Arduino 
// Wiring version by BARRAGAN <http://people.interaction-ivrea.it/h.barragan> 
// Modified for Arudino by djmatic
//char* strings must all be on one line, no returns between strings, otherwise it will mess up the text each time a string is called
#include <NewSoftSerial.h>//Must download and copy these libraries into your arduino folder to use them
#include <LiquidCrystal.h>//Thanks to everyone who has worked so hard and shared their work to make projects possible
#include "WProgram.h"
#include <Button.h>

Button start = Button(4,PULLUP);

int tag = 0;//starting point for "tag" integer
int started = 0;//used to prevent game select from working after start is pressed
int maxclue = 0;
int  val = 0;
int clue = 0;//starting point for "clue" integer
int bytesread = 0; 
char code[12]; 
char tag1[12] = {'0', '3', '0', '0', '8', '9', '9', '4', 'E', 'A'};
char tag2[12] = {'0', '3', '0', '0', '8', '9', 'C', '5', 'F', 'A'};
char tag3[12] = {'0', '3', '0', '0', '8', 'E', '6', '8', '8', '8'};
char tag4[12] = {'0', '3', '0', '0', '8', 'C', '7', '5', '1', '3'};
char tag5[12] = {'0', '3', '0', '0', '8', '4', 'C', 'D', '2', '9'};
char tag6[12] = {'0', '3', '0', '0', '8', '4', '3', 'D', 'F', '5'};
char tag7[12] = {'0', '3', '0', '0', '8', '4', '5', '5', '6', 'F'};
char clue1[] = {"Don't push me!                          I'll sway myself                        "};//controller for lcd is used for different sizes of
char clue2[] = {"You can only                            have a fire here                        "};//lcds. It treats each one as 20 characters with 4 lines.
char clue3[] = {"Why would a                             ghost be here?                          "};//So we need to use the first 16 characters as text that will
char clue4[] = {"Look here for                           loose change                            "};//be seen including place holding spaces, add 4 spaces, then 20 spaces after 1st
char clue5[] = {"The tooth Fairy                         left a gift!                            "};//and second lines because it will print 1st and 3rd line on a 16x2 lcd
char clue6[] = {"The key to it                           all is here                             "};//Change these to fit your own needs.
char clue7[] = {"The right box is                        the Right box                           "};
char* cluenumber[]={clue1,clue2,clue3,clue4,clue5,clue6,clue7};//when we call for clue we will use "cluenumber" followed by the stored "clue" integer to select which one in this array gets called for
char* tagnumber[]={tag1,tag2,tag3,tag4,tag5,tag6,tag7};//see cluenumber notes           
long previousMillis = 0;        // will store last time LED was updated
        // check for led on within this amount of time (milliseconds)
long time = 0;
LiquidCrystal lcd(6, 7, 8, 9, 10, 11);
NewSoftSerial RFIDSerial(12, 13);  // RFID reader TX pin to Arduino NewSoftSerial RX pin on Digital Pin 12
long hours=0;
long mins=0;
long secs=0;
void setup() { 
RFIDSerial.begin(2400); // RFID reader SOUT pin connected to NewSoftSerial RX pin at 2400bps
lcd.begin(16,2); // RFID reader SOUT pin connected to Serial RX pin at 2400bps 
pinMode (5, OUTPUT); //add transistor as a switch and use as power to RFID reader/ helps with disabling multiple reads (reader is 90ma when active, arduino pin puts out 40ma)
pinMode(2,OUTPUT);   // Set digital pin 2 as OUTPUT to connect it to the RFID /ENABLE pin 
Serial.begin(9600);
}  

void loop() { 
unsigned long currentMillis = millis();   
 if (started ==0){
 lcd.setCursor(0,0);
 lcd.print ("Press START to");
 lcd.setCursor (0,1);
 lcd.print ("begin game");
 }
 if (started == 0){//without this the start button can be pressed in the middle of a game and will restart the game clock
   if (start.uniquePress())
    {
      started++;//add 1 to the started integer
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Game started");
      lcd.setCursor(0,1);
      lcd.print("First Clue");
      previousMillis = millis();//we will use this later for determining the total time to complete the hunt
      delay(3000);
      lcd.clear();
    }
 }
 if (started >=1){
   lcd.setCursor (0,0);//set where we want to begin the text
   lcd.print(cluenumber[clue]);//print the current clue to the lcd
   digitalWrite(5,HIGH);//turn on power to the RFID reader, we will turn it off later to avoid duplicate readings
   digitalWrite(2,LOW);//enables the RFID reader
  if(RFIDSerial.available() > 0) {          // if data available from reader 
    if((val = RFIDSerial.read()) == 10) {   // check for header 
      bytesread = 0;
      while(bytesread<10) {              // read 10 digit code 
        if( RFIDSerial.available() > 0) { 
          val = RFIDSerial.read(); 
          if((val == 10)||(val == 13)) { // if header or stop bytes before the 10 digit reading 
            break;                       // stop reading 
          } 
          code[bytesread] = val;         // add the digit           
          bytesread++;                   // ready to read next digit  
        } 
      } 
      if(bytesread == 10) {              // if 10 digit read is complete 
       digitalWrite (5,LOW);             //turn off reader to stop multiple reads
       Serial.println (code);            //this will print the code in the serial monitor so we know it's working 
      } 
        if(strcmp(code, tagnumber[tag]) == 0) {//looks to see if the scanned tag matches the one it expects
	  if (maxclue >= 6){
currentMillis = millis();
time=currentMillis-previousMillis;//Thanks to Nikos Georgousis for his Uptime post on the arduino forum for the following time conversions
secs = time/1000; //convert milliseconds to seconds
mins=secs/60; //convert seconds to minutes
hours=mins/60; //convert minutes to hours
secs=secs-(mins*60); //subtract the coverted seconds to minutes in order to display 59 secs max
mins=mins-(hours*60); //subtract the coverted minutes to hours in order to display 59 minutes max
lcd.print ("Congratulations!");
lcd.setCursor (0,1);
lcd.print ("Treasure Found!");
delay(3000);
lcd.clear();
lcd.setCursor (0,0);
lcd.print ("Open the Box!!");
delay(3000);
lcd.clear();
lcd.setCursor (0,0);
lcd.print ("Time to complete");
lcd.setCursor (0,1);
lcd.print ("  hr:  min:  sec");
lcd.setCursor (0,1);
lcd.print (hours);
lcd.setCursor (5,1);
lcd.print (mins);
lcd.setCursor (11,1);
lcd.print (secs);
delay (600000);//don't do anything for 5 minutes.
 }
 else
 {
 clue++;//add 1 to the stored clue number
 tag++;//add 1 to the stored tag number
 maxclue++;//add 1 to max clue
 lcd.clear (); 
 lcd.setCursor (0,0);
 lcd.print ("You found it! ");
 lcd.setCursor (0,1);
 lcd.print ("Next Clue   ");
 delay(3000);
 lcd.clear();//important to clear, otherwise the lcd messes up the placement of the following clue
 lcd.print (cluenumber[clue]);    
        }
        }
        else if (strcmp(code, tagnumber[tag-1]) == 0){//This stops the arduino from doing anything from a multiple same tag (correct tag only ) read except 
          delay(1);//delay for 1 millisecond
          
        }
       
           else {//if tag scanned does not match expected tag, or previous correct tag, the following will happen
             lcd.clear (); 
          lcd.setCursor (0,0);
          lcd.print ("Wrong location! ");
          lcd.setCursor (0,1);
          lcd.print ("Re-read clue   ");
          delay (3000);
          lcd.clear ();
          lcd.print (cluenumber[clue]);
           }
    }     

 

    
} 
 }
}

Youtube link.

http://youtu.be/2cUBkF6iV8Y