commit fa36af2d2d4bea106c1f9ecd023234379f28415f Author: Demo User Date: Thu Feb 29 04:41:33 2024 +0000 testing code 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)