不错,我也去搞一套来试试。
楼主。。。引脚怎么接你没说清楚。,
:)不错,试了能调通
qq286983897 发表于 2013-7-9 10:49 static/image/common/back.gif
不错,试了能调通
管脚是怎么接的啊,就接4个引脚可以了吗?
楼主,第二个代码只能读取卡号啊?:'(是不是只要刷一下就行了?还是有别的操作?
有读有扇区的函数啊
//D10--读卡器MOSI引脚、 这个应该是片选引脚吧
怎么调不通啊,楼主把管脚说一下拜
秋刀鱼z 发表于 2013-11-10 15:41 static/image/common/back.gif
怎么调不通啊,楼主把管脚说一下拜
RFID -> Arduino UNO
-------------------
GND -> GND
VIN -> 5V
SS -> D10
SCK -> D13
MISI -> D11
MISO -> D12
3V# ->
RST -> D5
按照楼主接法调试成功,太感谢了!!:lol
一个板子 可以连接 多个 RC 522么 通过什么进行选择是那个 RC522 啊
好贴,学习了,应该赞一下~
纠结与不知道怎么读取CPU卡。。
楼主我有点不太明白程序...
blockAddr = 7; //数据块7
if (rfid.auth(PICC_AUTHENT1A, blockAddr, sectorKeyA, rfid.serNum) == MI_OK)//认证
{
//写数据
status = rfid.write(blockAddr, sectorNewKeyA);
Serial.print("set the new card password, and can modify the data of the Sector: ");
Serial.println(blockAddr/4,DEC);
//写数据
blockAddr = blockAddr - 3 ; //数据块4
status = rfid.write(blockAddr, writeDate);
if(status == MI_OK)
{
Serial.println("Write card OK!");
}
}
选择数据块7,然后在函数里是blockAddr/4,为什么写密码数据块地址要除于4啊?
还有就是写入数据的地址为什么是blockAddr - 3 //写在数据块4?
想问的就是,这个卡,到底有多少个数据块呀?可以分多少个部分存数据和对应的密码呢?不是很了解这些
问的有些傻,希望楼主能给我好好说说,小白感激不尽!!!!
楼主
blockAddr = 7; //数据块7
if (rfid.auth(PICC_AUTHENT1A, blockAddr, sectorKeyA, rfid.serNum) == MI_OK)//认证
{
//写数据
status = rfid.write(blockAddr, sectorNewKeyA);
Serial.print("set the new card password, and can modify the data of the Sector: ");
Serial.println(blockAddr/4,DEC);
//写数据
blockAddr = blockAddr - 3 ; //数据块4
status = rfid.write(blockAddr, writeDate);
if(status == MI_OK)
{
Serial.println("Write card OK!");
}
}
这里也不明白status = rfid.write(blockAddr, sectorNewKeyA);是写到 控制块 7吗,然后我改了unsigned char sectorNewKeyAAA = 的{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xff,0x07,0x80,0x69, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},为{0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xff,0x07,0x80,0x69, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}就不能读出来了,就是密码改了一下就不行了,这么改密码呢?