mxgxw / MFRC522-python

A small class to interface with the NFC reader Module MFRC522
GNU Lesser General Public License v3.0
521 stars 419 forks source link

some problem about the nSPI function #14

Closed xuxubin closed 9 years ago

xuxubin commented 9 years ago

Hi~ Thanks for this useful module. I can run the read.py file successfully

pi@raspberrypi ~/Documents/rfid_demo $ sudo python read.py 
Welcome to the MFRC522 data read example
Press Ctrl-C to stop.

but when I move the file to another directory error occured the command line output is:

pi@raspberrypi  ~/Document/mahjong/test_code $ sudo python read.py 
Traceback (most recent call last):
  File "read.py", line 21, in <module>
    MIFAREReader = MFRC522.MFRC522()
  File "/home/pi/Documents/mahjong/test_code/MFRC522.py", line 111, in __init__
    nSPI(device=dev,speed=spd)
NameError: global name 'nSPI' is not defined

so I wonder what is the function nSPI()? the code is absolutely the same. I am new to python. Thank you for your help!