树莓派Python3使用RC522
来源:互联网 发布:淘宝最红女主播 编辑:程序博客网 时间:2024/06/06 18:42
- 开启SPI通讯
sudo raspi-config找到SPi打开。
- 安装SPI模块
git clone https://github.com/lthiery/SPI-Pycd SPI-Py sudo python3 setup.py install
- 安装RFID模块
pip3 install pi-rc522 或者sudo pip3 install pi-rc522
- 获取UID
#!/usr/bin/python3from pirc522 import RFIDrdr = RFID()while True: rdr.wait_for_tag() (error, tag_type) = rdr.request() if not error: print("Tag detected") (error, uid) = rdr.anticoll() if not error: print("UID: " + str(uid)) # Select Tag is required before Auth if not rdr.select_tag(uid): # Auth for block 10 (block 2 of sector 2) using default shipping key A if not rdr.card_auth(rdr.auth_a, 10, [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF], uid): # This will print something like (False, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) print("Reading block 10: " + str(rdr.read(10))) # Always stop crypto1 when done working rdr.stop_crypto()# Calls GPIO cleanuprdr.cleanup()
阅读全文
1 0
- 树莓派Python3使用RC522
- 树莓派+RC522模块
- Arduino入门教程—RFID模块的使用(MF RC522)
- smart210裸机使用spi驱动RC522 Mifare模块
- RC522原装供应,RC522完美替代品供应
- 树莓派使用Python3获取天气信息
- RC522 SPI调试
- 射频RC522一些知识
- RC522 模块驱动程序
- RC522 SPI驱动 mini2440
- RC522 Access-card Arduino
- RC522 模块驱动程序
- RC522问题之一
- Python3 yield使用
- Python3 ctypes简单使用
- django python3 使用mysql
- python3使用cookie
- Ubuntu下使用Python3
- android 初看事件处理
- spark 报错:py4j.protocol.Py4JJavaError
- JSP中include静态文件HTML出乱码解决方案
- Java键盘输入方式总结
- HOMEJAVAJDK动态代理代理与Cglib代理原理探究
- 树莓派Python3使用RC522
- spark ml
- HDU1098数学归纳
- final关键字
- API学习StringBuilder
- 【布隆过滤器】实现一个简单的布隆过滤器
- Java中 VO、 PO、DO、DTO、 BO、 QO、DAO、POJO的概念
- Mysql本地基本操作梳理
- Java框架窗口基础