0

When I run the code

import RPi.GPIO as GPIO
from gpiozero import Button
button = Button(21)
from mfrc522 import SimpleMFRC522

reader = SimpleMFRC522()

id, text = reader.read()
if (text == "benfica"):
    button.wait_for_press
    print("hello")

the code will just stop and not wait for me to press the button. How do I stop it from doing this? Thanks.

I tried to change it up a little bit but couldn't

wjandrea
  • 28,235
  • 9
  • 60
  • 81
yesn't
  • 1
  • 1
  • 1
    I'm not familiar with this library, but I bet `button.wait_for_press` doesn't do anything on its own. Did you just forget to call it? `button.wait_for_press()`? – wjandrea Feb 05 '23 at 20:53

0 Answers0