Created
June 28, 2011 17:24
-
-
Save eberle1080/1051656 to your computer and use it in GitHub Desktop.
Schoolbus LED script
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
#!/usr/bin/env python | |
# Randomly change LED lights on schoolbus | |
import sys, random, time | |
def main(): | |
while True: | |
fh = open('/dev/led', 'w') | |
fh.write(random.choice(('shutdown', 'fault on', 'fault off', 'ready on')) + '\n') | |
fh.close() | |
time.sleep(random.randint(1, 10)) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment