as the title suggest I am unable to interface the MFRC522 module with a raspberry pi pico W. For context I mostly followed this explanation and after further research I found it is the most commonly used method. But my problem is that It doesn't want to work with me. I tried multiple hardware fix ideas such as replacing the wires, Soldering the headers etc. But nothing seems to work. Which leads me to suspect it is a software issue ? I found on another question on SO that suggests a different code which I tried but still nothing. The new code is as follows :
Main.py
import time
from machine import I2C, Pin, SPI
from mfrc522 import MFRC522
sck = Pin(2, Pin.OUT)
mosi = Pin(3, Pin.OUT)
miso = Pin(4, Pin.OUT)
spi = SPI(0, baudrate=100000, polarity=0, phase=0, sck=sck, mosi=mosi, miso=miso)
sda = Pin(1, Pin.OUT)
rst = Pin(0, Pin.OUT)
while True:
rdr = MFRC522(spi, sda, rst)
uid = ""
(stat, tag_type) = rdr.request(rdr.REQIDL)
print(stat)
if stat == rdr.OK:
(stat, raw_uid) = rdr.anticoll()
if stat == rdr.OK:
uid = ("0x%02x%02x%02x%02x" % (raw_uid[0], raw_uid[1], raw_uid[2], raw_uid[3]))
print(uid)
the SO post in question is this one I hope I made things clear.