18 lines
333 B
Python
18 lines
333 B
Python
import RPi.GPIO as GPIO
|
|
from time import sleep
|
|
from mfrc522 import SimpleMFRC522
|
|
|
|
GPIO.setmode(GPIO.BOARD)
|
|
|
|
print(GPIO.getmode())
|
|
GPIO.setup(37, GPIO.IN)
|
|
GPIO.setup(36, GPIO.IN)
|
|
i = 0
|
|
while True :
|
|
if GPIO.input(37) == 1:
|
|
print("+")
|
|
sleep(0.1)
|
|
if GPIO.input(36) == 1:
|
|
print("-")
|
|
sleep(0.1)
|
|
|