Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import time
- os.system("echo 48 > /sys/class/gpio/export")
- os.system("echo out > /sys/class/gpio/gpio48/direction")
- on = 0
- while(True):
- tmp_string = ""
- if on == 0:
- tmp_string = "echo 1 > /sys/class/gpio/gpio48/value"
- on = 1
- elif on == 1:
- tmp_string = "echo 0 > /sys/class/gpio/gpio48/value"
- on = 0
- if tmp_string != "":
- os.system(tmp_string)
- time.sleep(0.5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement