Hallo Community,
wenn ich dieses Python Skript ausführe:
Code
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
input_state = GPIO.input(18)
if input_state == False:
print('Button Pressed')
time.sleep(0.2)
Display More
bekomme ich folgenden Error:
Traceback (most recent call last):
File "bp.py", line 4, in <module>
GPIO.setmode(GPIO.BCM)
AttributeError: 'module' object has no attribute 'setmode'
Kann mir jemand helfen?
Danke im voraus
Grüße Vincent