summaryrefslogtreecommitdiff
path: root/gpioedge.py
blob: 097b690a95cce852472da58300e75017fd59fbc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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()