Writing a library and code complies but does nothing

Hi all,

I am writing a library to use with RFID it will do all the storing and compairing for me pretty much it is a work in progress

Now when i try and run the following code it complies and uploads but the serial commands do not return anything to the serial moniter window, i have uploaded other code to check the serial functions make sure i havent kill the board it self but they work.

Here is my code please let me know if you see anything that might be causing the problem.

Im using arduino 1.0

#include <RFIDTag.h>

int tag[14] = {
  1,2,3,4,5,6,7,8,9,10,11,12,13,14};
int tagGood[14] = {
  2,51,67,48,48,67,67,65,52,68,65,56,69,3};
RFIDTag rfid = RFIDTag(tagGood);
int pinReading = 13;
int pinGood = 11;
int pinBad = 12;

void setup()
{
  Serial.begin(9600);
  Serial.println("STARTED");
  //Serial.println(rfid.tagMatches(tag));
  pinMode(11,OUTPUT);
  pinMode(12,OUTPUT);
  pinMode(13,OUTPUT);
}

void loop()
{
  int tagTemp[14] = {
    1,2,3,4,5,6,7,8,9,10,11,12,13,14  };
  while(Serial.available() >= 14)
  {
    blinkLEDWithDelay(pinReading,10,150,50);
    for(int i = 0; i <= 14; i++)
    {
      tagTemp[i] = Serial.read();
    }
  }
  //check tag
  if(rfid.tagMatches(tagTemp))
  {
    Serial.println("TAG IS GOOD");
    blinkLEDWithDelay(pinGood,1,1000,50);
  }
  else
  {
    Serial.println("Tag is BAD!");
    blinkLEDWithDelay(pinBad,1,1000,50);
  }

}

void blinkLEDWithDelay(int led, int count, int timeOn, int timeOff)
{
  for(int i = 0; i <= count; i++)
  {
    digitalWrite(led,HIGH);
    delay(timeOn);
    digitalWrite(led,LOW);
    delay(timeOff);
  }
}

Library RFIDTag.h

// RFIDTag.h
// Ashley Hughes

#ifndef RFIDTag_h
#define RFIDTag_h

#include "Arduino.h"

class RFIDTag
{
public:
	RFIDTag(int tag1[]);
	boolean tagMatches(int testTag[]);
private:
	int _tag[14];
};

#endif

Library RFIDTag.cpp

// RFIDTag.cpp
// Ashley Hughes

#include "RFIDTag.h"
#include "Arduino.h"

RFIDTag::RFIDTag(int tag1[14])
{
	//store tag infomation locally
	memcpy(_tag, tag1, sizeof (_tag));
	delay(100);
}

boolean RFIDTag::tagMatches(int testTag[])
{
	Serial.print("Stored");
	Serial.print("\t=\t");
	Serial.print("Scanned");
	Serial.println("\tResult");
	for(int i = 0; i <= 13; i++)
	{
		Serial.print(_tag[i]);
		Serial.print("\t=\t");
		Serial.print(testTag[i]);
		if(testTag[i] == _tag[i])
		{
			Serial.println("\tTrue");
			//Continue
		}
		else
		{
			Serial.println("\tFalse");
			return false;
		}
	}
	return true;
}

Any help is greatly appreciated it was working a while ago as far as the comparing method till I changed it to allow it to read of the RFID reader. Before the change i was using hard coded tags it doesn't even display "STARTED"

You can't have a delay() in a constructor. The millis() timer, which delay() relies on, hasn't been set up at that point.

That's one of the reasons why other classes like Serial have a begin method, so that you can set up everything and then call it.

WizenedEE:
You can't have a delay() in a constructor. The millis() timer, which delay() relies on, hasn't been set up at that point.

That's one of the reasons why other classes like Serial have a begin method, so that you can set up everything and then call it.

Thanks that fixed it straight away, now just to work out why my RFID module will not work anymore