RFID Issue (EM-4100 tag)

Hi all.

I am using this RFID reader with the blue tags (http://www.parallax.com/product/32395).

I am using also the following code - that I think is correct, although the reader hasn’t worked yet. The reader does not read the tags, and the red light is constantly on.

int  val = 0;
char code[10];
int bytesread = 0;
 
void setup()
{
// RFID reader SOUT pin connected to Serial RX pin at 2400bps
Serial.begin(2400);
// Set digital pin 2 as OUTPUT to connect it to the RFID /ENABLE pin
pinMode(2,OUTPUT);
// Activate the RFID reader
digitalWrite(2, LOW);
}
 
 void loop()
 {
 
  if(Serial.available() > 0)
  {
    // if data available from reader
    // check for header
    if((val = Serial.read()) == 10)
    {
      bytesread = 0;
      // read 10 digit code
      while(bytesread<10)       {         if( Serial.available() > 0)
        {
          val = Serial.read();
          // if header or stop bytes before the 10 digit reading
          if((val == 10)||(val == 13))
          {
            // stop reading
            break;
          }
          // add the digit
          code[bytesread] = val;
          // ready to read next digit
          bytesread++;
        }
      }
      // if 10 digit read is complete
      if(bytesread == 10)
      {
        // possibly a good TAG
        Serial.print("TAG: ");
        // print the TAG code
        Serial.println(code);
      }
      bytesread = 0;
      // deactivate the RFID reader for a moment so it will not flood
      digitalWrite(2, HIGH);
      // wait for a bit
      delay(1500);
      // Activate the RFID reader
      digitalWrite(2, LOW);
    }
  }
}

Any suggestion? Or shall I throw my reader?

How have you wired it up? You seem to be using the serial port to read the reader and write to the serial monitor. Normally people use software serial to communicate with the reader.