Skip to content

Instantly share code, notes, and snippets.

@eberle1080
Created June 28, 2011 17:24
Show Gist options
  • Save eberle1080/1051656 to your computer and use it in GitHub Desktop.
Save eberle1080/1051656 to your computer and use it in GitHub Desktop.
Schoolbus LED script
#!/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