Why do I keep getting an error on code for RFID project?

Hi,
I just got a book called, “RFID For Beginners” by Tom Igoe and I used the code in the book for using a RFID reader with Arduino. But it gives me an error. I took a screen shot of the error and included it in the attached files. I made sure to include the SoftwareSerial library in the beginning. Here is the code that I am using:

/*
RFID Reader
*/

#include <SoftwareSerial.h> // Bring in the software serial library

const int tagLength = 10; // each tag ID contains 10 bytes
const int startByte = 0x0A; // Indicates start of a tag
const int endByte = 0x0D; // Indicates end of a tag

char tagID[tagLength + 1]; // array to hold the tag you read

const int rxpin = 6; // Pin for receiving data from the RFID reader
const int txpin = 7; // Transmit pin; not used
SoftwareSerial rfidPort(rxpin, txpin); // create a Software Serial port

void setup() {
// begin serial communication with the computer
Serial.begin(9600);

// begin serial communication with the RFID module
rfidPort.begin(2400);
}

void loop() {

// read in and parse serial data:
if (rfidPort.available() > 0) {

if (readTag()) {

Serial.println(tagID);
}
}
}

/*
This method reads the tag, and puts its
ID in the tagID
*/
boolean readTag() {

char thisChar = rfidPort.read();
if (thisChar == startByte) {

if (rfidPort.readBytesUntil(endByte, tagID, tagLength)) {
return true;
}

}
return false;
}

What am I doing wrong? I made sure I copied exactly as it was in the book (well, I copied and pasted cause it was an ebook so it really should be the same). Any help would be greatly appreciated! Thanks!

Jacob

Using Arduino IDE v1.0.1 the program you supplied compiles without error.

Binary sketch size: 4,684 bytes (of a 32,256 byte maximum)

Riva: Using Arduino IDE v1.0.1 the program you supplied compiles without error.

Binary sketch size: 4,684 bytes (of a 32,256 byte maximum)

Cool! I have Arduino 0022. Thanks for the fast response! I'll download it as soon as possible.

Cool! I have Arduino 0022. Thanks for the fast response! I'll download it as soon as possible.

SoftwareSerial prior to 1.0 was garbage. You should have been using NewSoftSerial. NewSoftSerial replaced SoftwareSerial for 1.0.

PaulS: SoftwareSerial prior to 1.0 was garbage. You should have been using NewSoftSerial. NewSoftSerial replaced SoftwareSerial for 1.0.

So if I were to download the NewSoftSerial library, could I use that in place of the SoftwareSerial library with the same code and it would work?

So if I were to download the NewSoftSerial library, could I use that in place of the SoftwareSerial library with the same code and it would work?

With version 0023, yes.

Ok. Thanks Riva and PaulS for your help. Mucho appreciated!