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 --- gpiotest.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 gpiotest.py (limited to 'gpiotest.py') diff --git a/gpiotest.py b/gpiotest.py new file mode 100755 index 0000000..130c03d --- /dev/null +++ b/gpiotest.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +import turris_gpio as gpio + +gpio.setmode(gpio.BCM) + +gpio.setup(33, gpio.OUT) +gpio.setup(18, gpio.IN) + +gpio.output(33, 0) +if not gpio.input(18): + print("0 fine") +else: + print("0 failed") + + +gpio.output(33, 1) +if gpio.input(18): + print("1 fine") +else: + print("1 failed") + +gpio.cleanup() -- cgit v1.2.3