we’re writing a library on Zerynth for the “Card Reader” RFID MRFC 522.
After initializing the device we’ve found problems with “spi.lock” and “spi.select”.
The error is an “AttributeError”
This is the code:
def Write_MFRC522(self, addr, val):
# Create an array with the data to shift out
buffer = bytearray(0)
for i in range(2): self.spidata[i] = 0 # Put our device data into the array self.spidata = addr self.spidata = val for i in range(2, 0, -1): buffer.append(self.spidata[i-1]) self.lock() #enable the line self.select() try: self.exchange(buffer) except Exception as e: print(e) finally: self.unselect() self.unlock()
We already checked the frequency of the clock and the modes of the SPI.
Thank you for your support