Is there a way to detect to detect change in raspberry pi GPIO without using a infinite loop?
You can detect rise or fall by using this:
GPIO.add_event_detect(channel, GPIO.RISING, callback=my_callback)
But you only can set event detector for either falling or rising at a time. Is there any way to do it without checking the input in a infinite loop?