Ho trovato qualcosa!!!
http://thetransistor.com/2011/10/hacking-cheap-rfid-readers/Sembrava che poteva risolvere i miei problemi!
Invece non è stato cosi... Dove sbaglio?
La scheda che usa lui è molto simile alla mia! E credo che ha gli stessi componenti e le stesse uscite!
Ho provato ad utilizzare il suo Sketch ma il risultato è una pagina bianca!
// Ebay RFID decoder by Aaron Christiansen
// NOTE: this uses the NewSoftwareSerial beta 11
// by Mikal Hart, available here:
// http://arduiniana.org/2011/01/newsoftserial-11-beta/
#include <SoftwareSerial.h>
SoftwareSerial rfid(3, 4);
void setup(){
rfid.begin(9600);
Serial.begin(9600);
}
void loop(){
if(rfid.available()){
Serial.println(readRFID());
}
}
String readRFID(){
String out = "";
int temp = 0;
unsigned long timer = millis() + 1000;
// using a timer to prevent a possible hang
while(out.length() < 10 && timer > millis()){
if(rfid.available()){
temp = rfid.read() - 29;
if(temp > -1 && temp < 11){
temp = (temp == 10)? 0 : temp;
out += temp;
}
}
}
// clearing out the unused extra bytes
rfid.flush();
return out;
}
ho provato a mettere la visualizzazione dei dati prima di String readRFID() ma ottengo quello che ottenevo all' inizio numeri senza senso divisi su 4 righe!!! Sembra che fa 4 letture!!! Perche?
Aiuto!
