I'm back with more noob questions about RFID! I'm using an Arduino Duemilanove with an ID-20 reader and trying to use a simple program to just confirm that it's picking up a card. All I get in the Serial Monitor is a bunch of squares, whether a card is present or not. Here is the code:
#include <SoftwareSerial.h>
#define rxPin 2
#define txPin 3
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
void setup() {
// define pin modes for tx, rx, led pins:
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
mySerial.begin(9600);
Serial.begin(9600);
}
void loop() {
char someChar = mySerial.read();
Serial.print(someChar);
}
It's slightly modified from this example .
It's connected like so, after reading the datasheet and looking at examples:
Arduino 5V (under Power) ------> 11 (5V), 2 (RST)
Arduino GND (under Power) ----> 1 (GND), 7 (FS)
Arduino 2 (under Digital)--------> 9 (DO)
I also tried the following code, switching 9 (DO) on the reader to 1 (RX) on the Arduino. In that case, all I get is ÿ each time it loops.
void setup() {
Serial.begin(9600);
}
void loop () {
Serial.print((char)Serial.read());
}
I thought the output would be in ASCII since I set the Format Select to GND, which the datasheet says will make it ASCII. But neither the square nor the ÿ exists on the ASCII table, so I have no idea where this is coming from.
I wanted to make sure, so I tried changing it to:
void loop () {
if (Serial.read() != 'ÿ') {
Serial.print((char)Serial.read());
}
...but it printed out a lot of ÿÿÿÿÿÿÿÿÿÿÿ anyway.
SO. Can anyone please shed some insight on what all these squares and ÿ mean?