#!/usr/bin/env python2 import turris_gpio as gpio gpio.setmode(gpio.BCM) gpio.setup(18, gpio.IN) channel = gpio.wait_for_edge(18, gpio.BOTH, timeout=5000) print("both " + str(channel)) channel = gpio.wait_for_edge(18, gpio.RISING) print("rising " + str(channel)) channel = gpio.wait_for_edge(18, gpio.FALLING) print("falling " + str(channel)) channel = gpio.wait_for_edge(18, gpio.BOTH) print("both " + str(channel)) channel = gpio.wait_for_edge(18, gpio.BOTH) print("both " + str(channel)) gpio.cleanup()