From fa36af2d2d4bea106c1f9ecd023234379f28415f Mon Sep 17 00:00:00 2001 From: Demo User Date: Thu, 29 Feb 2024 04:41:33 +0000 Subject: [PATCH] testing code --- gpio-test.py | 13 +++++++++++++ gpio.py | 11 +++++++++++ 2 files changed, 24 insertions(+) create mode 100644 gpio-test.py create mode 100644 gpio.py diff --git a/gpio-test.py b/gpio-test.py new file mode 100644 index 0000000..cb49756 --- /dev/null +++ b/gpio-test.py @@ -0,0 +1,13 @@ +#!/usr/bin/python + +import sys +GPIO="/sys/class/gpio/gpio11" + +fo = open(GPIO + "/direction", "w") +fo.write("out") +fo = open(GPIO + "/value", "w") +fo.write("0") +fo = open(GPIO + "/value", "r") +read = fo.read() +print(read) + diff --git a/gpio.py b/gpio.py new file mode 100644 index 0000000..5f86c9e --- /dev/null +++ b/gpio.py @@ -0,0 +1,11 @@ +import sys +GPIO="/sys/class/gpio/gpio11" + +def write(): + fo = open(GPIO + "/direction", "w") + fo.write("out") + fo = open(GPIO + "/value", "w") + fo.write("1") + fo = open(GPIO + "/value", "r") + read = fo.read() + print(read)