我通过SPI用SPI切换PN532 (在我使用rc522通过SPI测试RPI并且模块正常工作之前)
阅读代码https://github.com/adafruit/Adafruit_Python_PN532 例如/ readmifare.py
与线路的连接: 对于RPi3b
RPI - PN532
17 3.3v VCC
20 Ground GND
19 MOSI MOSI
21 MISO MISO
23 SCLK SCK
24 CE0 SS
26 CE1
我改变代码:
#Conf for RPi 3
CS = 24
MOSI = 19
MISO = 21
SCLK = 23
Traceback (most recent call last):
File "readmifare.py", line 54, in <module>
pn532.begin()
File "/home/pi/Adafruit_Python_PN532/examples/PN532.py", line 343, in begin
self.get_firmware_version()
File "/home/pi/Adafruit_Python_PN532/examples/PN532.py", line 352, in get_firmware_version
raise RuntimeError('Failed to detect the PN532! Make sure there is sufficient power (use a 1 amp or greater power supply), the PN532 is wired correctly to the device, and the solder joints on the PN532 headers are solidly connected.')
RuntimeError: Failed to detect the PN532! Make sure there is sufficient power (use a 1 amp or greater power supply), the PN532 is wired correctly to the device, and the solder joints on the PN532 headers are solidly connected.