Browse Source

testing code

master
Demo User 10 months ago
commit
fa36af2d2d
2 changed files with 24 additions and 0 deletions
  1. +13
    -0
      gpio-test.py
  2. +11
    -0
      gpio.py

+ 13
- 0
gpio-test.py View File

@ -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)

+ 11
- 0
gpio.py View File

@ -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)

Loading…
Cancel
Save