From 1bf374ab7e2657380b3c23ec4a9d9ba01c627a81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 21 Apr 2017 12:58:17 +0200 Subject: Just dump all test scripts here --- gpioedge.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 gpioedge.py (limited to 'gpioedge.py') diff --git a/gpioedge.py b/gpioedge.py new file mode 100755 index 0000000..097b690 --- /dev/null +++ b/gpioedge.py @@ -0,0 +1,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() -- cgit v1.2.3