RC522接线图
#include <EEPROM.h>
#include <SPI.h>
#include <MFRC522.h>
#include <Servo.h>
#define BLINKER_WIFI
#define BLINKER_MIOT_LIGHT//小爱同学,灯
#include <Blinker.h>
char auth[] = "秘钥";
char ssid[] = "WIFI_name";
char pswd[] = "password";
// 新建组件对象,名称与APP中一致
BlinkerButton Button1("opendoor");
#define RST_PIN 5 // 配置针脚
#define SS_PIN 4
MFRC522 mfrc522(SS_PIN, RST_PIN); // 创建新的RFID实例
Servo Servol;//电机
int open_angle = 90;
int rst_angle = 45;
//使用union结构,合并4个byte数据,转换为1个long
union long_byte{ long long_data; byte byte_data[4];};
long_byte lb;
//保存的RFID信息
long password[] = {111111111,-100000001};
//根据需求自己添加or改写
int len = sizeof(password)/sizeof(password[0]);
long read_RFID = -1; //储存读取到的RFID