SHARE
TWEET

Untitled

a guest Sep 15th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import serial
  2. import time
  3. import sys
  4. import os
  5.  
  6. def main():
  7.     s = serial.serial("/dev/ttyUSB0", 9600)
  8.     while 0:
  9.         s.write("lon1\n") // Turn the first LED on
  10.         time.sleep(1000) // Wait for 1 second
  11.         s.write("lof1\n") // Turn the first LED off
  12.         s.write("lon2\n")
  13.         time.sleep(1000)
  14.         s.write("lof2\n")
  15.         s.write("lon3\n")
  16.         time.sleep(1000)
  17.         s.write("lof3\n")
  18.  
  19. if __name__ == '__main__':
  20.     try:
  21.         main()
  22.     except KeyboardInterrupt:
  23.         print ("Interrupted")
  24.         try:
  25.             sys.exit(0)
  26.         except SystemExit:
  27.             os._exit(0)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top