cnkids 发表于 2012-7-31 22:00:23

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的程序,改了一些..是在不知道卡号匹配比较从哪加进去。。。求高手~

txmg 发表于 2012-8-1 00:51:12

我这里有个实例!#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:53:00

库文件。。。。。。。。。。!

cnkids 发表于 2012-8-1 02:02:40

txmg 发表于 2012-8-1 00:51 static/image/common/back.gif
我这里有个实例!#include




半夜睡不着,爬起来看看~

cnkids 发表于 2012-8-1 02:03:49

txmg 发表于 2012-8-1 00:53 static/image/common/back.gif
库文件。。。。。。。。。。!

:dizzy:貌似我还没达到可以下载的要求。。。

cnkids 发表于 2012-8-1 03:31:45

txmg 发表于 2012-8-1 00:51 static/image/common/back.gif
我这里有个实例!#include




NewSoftSerial RFID(2, 3);
这个定义的是啥。。。

txmg 发表于 2012-8-1 11:58:18

cnkids 发表于 2012-8-1 03:31 static/image/common/back.gif
NewSoftSerial RFID(2, 3);
这个定义的是啥。。。

多使用谷歌!!http://arduino.cc/en/Reference/SoftwareSerialConstructor

txmg 发表于 2012-8-1 11:58:46

cnkids 发表于 2012-8-1 02:03 static/image/common/back.gif
貌似我还没达到可以下载的要求。。。

设置的就是注册会员。。。。。

cnkids 发表于 2012-8-1 15:59:29

txmg 发表于 2012-8-1 11:58 static/image/common/back.gif
多使用谷歌!!http://arduino.cc/en/Reference/SoftwareSerialConstructor

好吧,3Q~大半夜的看程序果然会昏~我再仔细研究研究

cnkids 发表于 2012-8-1 15:59:58

txmg 发表于 2012-8-1 11:58 static/image/common/back.gif
设置的就是注册会员。。。。。

昨晚默默的去回了许多帖子才变成注册会员。。

若神 发表于 2013-9-6 21:26:31

好吧,权限不够:Q

myfzh 发表于 2014-8-7 15:58:46

:L权限不够

zwltanf 发表于 2014-8-7 17:10:56

txmg 发表于 2012-8-1 00:51 static/image/common/back.gif
我这里有个实例!#include




先留着,   

cnkids 发表于 2014-8-19 01:32:24

myfzh 发表于 2014-8-7 15:58 static/image/common/back.gif
权限不够

分不够?多回复几篇帖子赚点分呗
页: [1]
查看完整版本: RFID模块能够读卡号,如何将读出的卡号存储后,再读卡时进行匹配是否相等?