catcher

trun_on.py

Jun 1st, 2016
129
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2.  
  3. import serial
  4. from time import sleep
  5.  
  6. ser = serial.Serial(
  7.         port='/dev/ttyUSB0',
  8.         baudrate = 115200,
  9.         parity=serial.PARITY_NONE,
  10.         stopbits=serial.STOPBITS_ONE,
  11.         bytesize=serial.EIGHTBITS,
  12.         timeout=1)
  13.  
  14.  
  15. print 'sending:'
  16. ser.write('25;2;1;1;2;0\n')
  17. sleep(0.2)
  18. ser.write('25;1;1;1;2;0\n')
  19. sleep(0.2)
  20. ser.write('25;0;1;1;2;0\n')
  21. sleep(0.2)
  22. print 'DONE'
RAW Paste Data