Parallax RFID Reader with NewSoftSerial Library

Hey Everyone,

I'm trying to hook up a Parallax RFID reader using NewSoftSerial so I can have multiple serial connections.

Everything is working fine so far, except for the RFID reader. When I use the stock SoftwareSerial library, the reader works like a charm, but when I read a tag using the NewSoftSerial library it puts out a bunch of random gibberish like 2ÿÿÿÿÿÿÿÿÿ.

If anyone has any idea whats going on I'd really appreciate it.

Thanks!

Whenever I see that umlaut-y, I first guess that you are calling read() without checking available() first. Unlike SoftwareSerial, NewSoftSerial's read() function returns -1 if there is no character available. If you want to make sure you get real data, wait until available() returns a value greater than 0:

while (nss.available() == 0)
  ; // do nothing
char c = nss.read();

Mikal