Raspberry Pi - LED and Button Projects
Find the bug in this reaction time game code:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(22, GPIO.IN)
start = time.time()
while GPIO.input(22) == GPIO.LOW:
pass
end = time.time()
print('Reaction time:', end - start)