add the devmem2.py and blink files

This commit is contained in:
2021-09-07 13:29:44 -04:00
parent 1e28040cec
commit 2f0105f826
2 changed files with 62 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/python3
import time, os, sys
os.chdir("/sys/class/gpio/")
os.system("echo {} > export".format(sys.argv[1]))
os.chdir("gpio{}".format(sys.argv[1]) )
os.system("echo out > direction")
for i in range(20):
os.system("echo 1 > value")
time.sleep(1)
os.system("echo 0 > value")
time.sleep(0.2)