-
-
Save Yettimania/0ac39127aeb39b0ce47d to your computer and use it in GitHub Desktop.
BeagleBone Black Blink with Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
setupPin = file("/sys/class/gpio/export","w") | |
setupPin.write("%d" % (44)) | |
setupPin.close() | |
setupPin = file("/sys/class/gpio/gpio44/direction", "w") | |
setupPin.write("out") | |
setupPin.close() | |
outPin = file("/sys/class/gpio/gpio44/value", "w") | |
try: | |
while True: | |
outPin.write("1") | |
outPin.flush() | |
time.sleep(1) | |
outPin.write("0") | |
outPin.flush() | |
time.sleep(1) | |
except KeyboardInterrupt: | |
inPin = file("/sys/class/gpio/unexport", "w") | |
inPin.write("%d" % (44)) | |
inPin.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment