標題: RFID writer [打印本頁] 作者: black7871 時間: 2012-8-10 01:56 標題: RFID writer 你好上星期我向貴公司購買一組RFID Writer和tag卡
我是要用Arduino讀取RFID
我有去看官網的範例
但是就是讀不到也寫不進去
接腳也照上面的接了
請問這是什麼問題
程式:
//Code to write data to Parallax RFID reader/writer 28440 from Arduino
//Program writes to one of the 29 user-defined addresses (3-31) as define by whichSpace
//The four bytes to be written are defined by first, second, third, and fourth
//Coded by vgrhcp, adapted to arduino 1.0 by sebflippers
#define first 1 // first, second, thrid, and fourth are four arbitrary values which will be written to the RFID tag at address whichSpace
#define second 26
#define third 3
#define fourth 27
void suppressAll() //Keeps error code & the "write confirmation" codes from being printed in the serial monitor
{
if(mySerial.available() > 0)
{ mySerial.read();
suppressAll();
}
}
if(mySerial.available() > 0) {
val = mySerial.read();
if (val == 1) //If data was written successfully
{ Serial.println("Data written succesfully!");
suppressAll();
}
else suppressAll(); //If an error occured during writing, discard all data recieved from the RFID writer
}
delay(250);
}