I also tried to use the code below (and others code) but i got errors:
#include "SoftwareSerial.h"
#define txPin 11
#define rxPin 10
SoftwareSerial RFID(rxPin, txPin);
void setup()
{
Serial.begin(9600);
RFID.begin(9600);
pinMode(txPin, OUTPUT); //pin 22
pinMode(rxPin, INPUT); //pin 24
Serial.println("Seriport Menu");
Serial.println("a - Test Menu");
Serial.println("b - Read card");
Serial.println("");
delay(2000); // RFID wait time:
}
void loop() {
if (Serial.available() > 0) {
char incomingByte = Serial.read();
switch (incomingByte) {
case 'a': // if user enters 'a' show test print
Serial.print("Test menu....");
break;
case 'b': // if user enters 'b' start card reading
Serial.print("Card Reading Started");
RFID.write(0xAB);
RFID.write(0x02);
RFID.write(0x02);
if (RFID.available()>0)
{
Serial.print("Card number is:");
Serial.print(RFID.read(), HEX);
Serial.println(" ");
}
break;
}
}
}
ERRORS
avrdude: stk500v2_command(): unknown status 0xc8
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: stk500v2_command(): unknown status 0x01
avrdude: stk500v2_disable(): failed to leave programming mode