• 大小: 76KB
    文件类型: .7z
    金币: 1
    下载: 0 次
    发布日期: 2021-05-12
  • 语言: 其他
  • 标签:

资源简介

STC89C52RC 智能家居设计(GSM+人体红外+电磁锁+薄膜键盘+LCD12864+DS3231)

资源截图

代码片段和文件信息

#include “AT24C32.h“

void recordUsrNameAndPassword(uchar *name uchar *pwd uchar times){
writeArray(name 0 USR_NAME 17 AT24C02_WRITE_CMD 1);
writeArray(pwd 0 USR_PWD 7 AT24C02_WRITE_CMD 1);
writeByte2Addr(0 USR_ERROR_TIMES times AT24C02_WRITE_CMD 1);
}

uchar getUsrNameAndPassword(uchar *name uchar *pwd){
readArray(name 0 USR_NAME 16 AT24C02_WRITE_CMD AT24C02_READ_CMD 1);
readArray(pwd 0 USR_PWD 6 AT24C02_WRITE_CMD AT24C02_READ_CMD 1);
return readByteFromAddr(0 USR_ERROR_TIMES AT24C02_WRITE_CMD AT24C02_READ_CMD 1);
}

void recordAdminNameAndPassword(uchar *name uchar *pwd){
writeArray(name 0 ADMIN_NAME 17 AT24C02_WRITE_CMD 1);
writeArray(pwd 0 ADMIN_PWD 7 AT24C02_WRITE_CMD 1);
}

void getAdminNameAndPassword(uchar *name uchar *pwd){
readArray(name 0 ADMIN_NAME 16 AT24C02_WRITE_CMD AT24C02_READ_CMD 1);
readArray(pwd 0 ADMIN_PWD 6 AT24C02_WRITE_CMD AT24C02_READ_CMD 1);
}

评论

共有 条评论