Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Import Libraries
- ##################
- #Tell python we need the library "os" for executing system commands directly
- import os
- #Tell python we need the library "time" so we can use the "sleep" command
- import time
- i = 0;
- total_gpio = 96;
- while(i < total_gpio):
- #Tell beaglebone we want to export this GPIO pin
- os.system("echo "+str(i)+" > /sys/class/gpio/export");
- time.sleep(0.1);
- #Tell beaglebone we want to turn this gpio pin to OUTPUT
- os.system("echo out > /sys/class/gpio/gpio"+str(i)+"/direction");
- #Tell beaglebone we want to turn this gpip pin on
- os.system("echo 1 > /sys/class/gpio/gpio"+str(i)+"/value");
- print "Last pin turned on was "+str(i)+"\n";
- time.sleep(0.1);
- i = i + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement