Skip to content

Commit a4f2a14

Browse files
authored
Update mfrc522.py
Added LoPy and FiPy platform (same API)
1 parent 31247a8 commit a4f2a14

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mfrc522.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ def __init__(self, sck, mosi, miso, rst, cs):
2323

2424
self.rst.value(0)
2525
self.cs.value(1)
26+
27+
board = uname()[0]
2628

27-
if uname()[0] == 'WiPy':
29+
if board == 'WiPy' || board == 'LoPy' || board == 'FiPy':
2830
self.spi = SPI(0)
2931
self.spi.init(SPI.MASTER, baudrate=1000000, pins=(self.sck, self.mosi, self.miso))
30-
elif uname()[0] == 'esp8266':
32+
elif board == 'esp8266':
3133
self.spi = SPI(baudrate=100000, polarity=0, phase=0, sck=self.sck, mosi=self.mosi, miso=self.miso)
3234
self.spi.init()
3335
else:

0 commit comments

Comments
 (0)