Merge branch 'master' into master
This commit is contained in:
commit
65ebda1f39
9 changed files with 275 additions and 2 deletions
22
MFRC522.py
22
MFRC522.py
|
@ -1,5 +1,25 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf8 -*-
|
||||
#
|
||||
# Copyright 2014,2018 Mario Gomez <mario.gomez@teubi.co>
|
||||
#
|
||||
# This file is part of MFRC522-Python
|
||||
# MFRC522-Python is a simple Python implementation for
|
||||
# the MFRC522 NFC Card Reader for the Raspberry Pi.
|
||||
#
|
||||
# MFRC522-Python is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# MFRC522-Python is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with MFRC522-Python. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
import RPi.GPIO as GPIO
|
||||
import spi
|
||||
|
@ -110,7 +130,7 @@ class MFRC522:
|
|||
def __init__(self, dev='/dev/spidev0.0', spd=1000000):
|
||||
spi.openSPI(device=dev,speed=spd)
|
||||
GPIO.setmode(GPIO.BOARD)
|
||||
GPIO.setup(22, GPIO.OUT)
|
||||
GPIO.setup(NRSTPD, GPIO.OUT)
|
||||
GPIO.output(self.NRSTPD, 1)
|
||||
self.MFRC522_Init()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue