Skip to content

Instantly share code, notes, and snippets.

@Bolt64
Created February 6, 2014 06:48
Show Gist options
  • Save Bolt64/8839401 to your computer and use it in GitHub Desktop.
Save Bolt64/8839401 to your computer and use it in GitHub Desktop.
Threading for a raspberry pi bot
#!/usr/bin/env python3
import threading
class led_thread(threading.Thread):
def run(self):
print('Doing led stuff')
#Other stuff
class listener_thread(threading.Thread):
def run(self):
print('Listening')
#Other stuff
def main():
leds=led_thread()
listener=listener_thread()
leds.start()
listener.start()
leds.join()
listener.join()
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment