import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(2, GPIO.IN)
while True:
if GPIO.input(2) == False:
print ("marshmallow makes a good input")
time.sleep(0.5)
File "marshmallow.py" , line 11
print ("marshmallow makes a good input")
^
IndentationError: expected an indented block
我得到這個代碼從一本書,我不知道什麼是錯的......
的代碼應該當虛假和印刷「棉花糖是一個很好的投入」時,什麼都不要做,但無論如何要感謝 – user3574657