Advertisement
SoapSuds

BeagleBone Blink Custom LED on P9 - PIN 15

Mar 16th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. import os
  2. import time
  3.  
  4. os.system("echo 48 > /sys/class/gpio/export")
  5. os.system("echo out > /sys/class/gpio/gpio48/direction")
  6.  
  7. on = 0
  8. while(True):
  9.     tmp_string = ""
  10.     if on == 0:
  11.         tmp_string = "echo 1 > /sys/class/gpio/gpio48/value"
  12.         on = 1
  13.     elif on == 1:
  14.         tmp_string = "echo 0 > /sys/class/gpio/gpio48/value"
  15.         on = 0
  16.  
  17.     if tmp_string != "":
  18.         os.system(tmp_string)
  19.     time.sleep(0.5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement