remove old rfid-implements
This commit is contained in:
@@ -1,30 +0,0 @@
|
|||||||
#include <unistd.h>
|
|
||||||
#include "MFRC522.h"
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
MFRC522 mfrc;
|
|
||||||
|
|
||||||
mfrc.PCD_Init();
|
|
||||||
|
|
||||||
while(1)
|
|
||||||
{
|
|
||||||
if(!mfrc.PICC_IsNewCardPresent())
|
|
||||||
continue;
|
|
||||||
if(!mfrc.PICC_ReadCardSerial())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
for(byte i = 0; i < mfrc.uid.size; ++i){
|
|
||||||
if(mfrc.uid.uidByte[i] < 0x10){
|
|
||||||
printf(" 0");
|
|
||||||
printf("%X",mfrc.uid.uidByte[i]);
|
|
||||||
} else {
|
|
||||||
printf(" ");
|
|
||||||
printf("%X", mfrc.uid.uidByte[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
printf("\n");
|
|
||||||
usleep(1000*1000);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
#include <unistd.h>
|
|
||||||
#include <iostream>
|
|
||||||
#include <ctime>
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
#include "MFRC522.h"
|
|
||||||
|
|
||||||
MFRC522 mfrc;
|
|
||||||
|
|
||||||
uint32_t getUID()
|
|
||||||
{
|
|
||||||
uint32_t uid = int((unsigned char)(mfrc.uid.uidByte[0]) << 24 |
|
|
||||||
(unsigned char)(mfrc.uid.uidByte[1]) << 16 |
|
|
||||||
(unsigned char)(mfrc.uid.uidByte[2]) << 8 |
|
|
||||||
(unsigned char)(mfrc.uid.uidByte[3]));
|
|
||||||
return uid;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
mfrc.PCD_Init();
|
|
||||||
|
|
||||||
while(true)
|
|
||||||
{
|
|
||||||
if(!mfrc.PICC_IsNewCardPresent())
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if(!mfrc.PICC_ReadCardSerial())
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
printf("\n");
|
|
||||||
std::time_t result = std::time(nullptr);
|
|
||||||
std::cout << std::asctime(std::localtime(&result));
|
|
||||||
|
|
||||||
printf("%X\n", getUID());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("\n");
|
|
||||||
usleep(1000*1000);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user