RFID模块能够读卡号,如何将读出的卡号存储后,再读卡时进行匹配是否相等?
本帖最后由 cnkids 于 2012-8-1 21:30 编辑char Str1;
int i=0;
const int ENPin = 2; // the number of the EN pin
int ENState = 1;//default EN state was HIGH
unsigned char ID = {0x00,0x17,0x3E,0x41};
int val = 0;
int status = 0;
void setup()
{
Serial.begin(9600);
pinMode(ENPin, INPUT);
}
void loop()
{
// read the state of the EN value:
ENState = digitalRead(ENPin);
// check if the EN is LOW,the output the data.
while(ENState == LOW&&Serial.available() > 0)
{
// read the incoming byte:
Str1 = Serial.read();
if(i>=3)
{
i=0;
Serial.println(" ");
}
else
{
Serial.print(Str1, HEX);
i++;
}
}
i=0;
}
用的是thomas的程序,改了一些..是在不知道卡号匹配比较从哪加进去。。。求高手~ 我这里有个实例!#include <NewSoftSerial.h>
NewSoftSerial RFID(2, 3);
String msg;
String ID ;//string to store allowed cards
void setup()
{
Serial.begin(9600);
Serial.println("Serial Ready");
RFID.begin(9600);
Serial.println("RFID Ready");
}
char c;
int i=1;
void loop(){
while(RFID.available()>0){
c=RFID.read();
msg += c;
Serial.println(msg);//Uncomment to view your tag ID
Serial.println(msg.length());
}
}
库文件。。。。。。。。。。! txmg 发表于 2012-8-1 00:51 static/image/common/back.gif
我这里有个实例!#include
半夜睡不着,爬起来看看~ txmg 发表于 2012-8-1 00:53 static/image/common/back.gif
库文件。。。。。。。。。。!
:dizzy:貌似我还没达到可以下载的要求。。。 txmg 发表于 2012-8-1 00:51 static/image/common/back.gif
我这里有个实例!#include
NewSoftSerial RFID(2, 3);
这个定义的是啥。。。 cnkids 发表于 2012-8-1 03:31 static/image/common/back.gif
NewSoftSerial RFID(2, 3);
这个定义的是啥。。。
多使用谷歌!!http://arduino.cc/en/Reference/SoftwareSerialConstructor cnkids 发表于 2012-8-1 02:03 static/image/common/back.gif
貌似我还没达到可以下载的要求。。。
设置的就是注册会员。。。。。 txmg 发表于 2012-8-1 11:58 static/image/common/back.gif
多使用谷歌!!http://arduino.cc/en/Reference/SoftwareSerialConstructor
好吧,3Q~大半夜的看程序果然会昏~我再仔细研究研究
txmg 发表于 2012-8-1 11:58 static/image/common/back.gif
设置的就是注册会员。。。。。
昨晚默默的去回了许多帖子才变成注册会员。。 好吧,权限不够:Q :L权限不够 txmg 发表于 2012-8-1 00:51 static/image/common/back.gif
我这里有个实例!#include
先留着, myfzh 发表于 2014-8-7 15:58 static/image/common/back.gif
权限不够
分不够?多回复几篇帖子赚点分呗
页:
[1]