From d7868df8cdfcd0f25e93835fa24f9b6fb5cbae70 Mon Sep 17 00:00:00 2001 From: Gerardo Marx Date: Thu, 27 Feb 2025 10:00:54 -0600 Subject: [PATCH] Testing functions --- main.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index de38f15..9116c2f 100755 --- a/main.py +++ b/main.py @@ -1,12 +1,15 @@ #!/usr/bin/python3 -import sys -GPIOPATH = "/sys/class/gpio/" -fo = open(GPIOPATH + "gpio60/direction", "w") -fo.write("out") -fo.close() +GPIO60 = "/sys/class/gpio/gpio60/" -fo = open(GPIOPATH + "gpio60/value", "w") -fo.write("1") -fo.close() +def writeVal(path, direction, value): + fop = open(path + "direction", "w") + fop.write(direction) + fop.close() + fov = open(path + "value", "w") + fov.write(value) + fov.close() + return + +writeVal(GPIO60, "out", "1")