Skip to content

Instantly share code, notes, and snippets.

@AlexEshoo
Created March 16, 2018 19:58
Show Gist options
  • Save AlexEshoo/22fd728ccb0f0417a337f32f393b80b7 to your computer and use it in GitHub Desktop.
Save AlexEshoo/22fd728ccb0f0417a337f32f393b80b7 to your computer and use it in GitHub Desktop.
import serial
import threading
port = serial.Serial(
port='COM14',
baudrate=9600,
timeout=10
)
def write_power(p):
port.write(p)
p = b'0'
thread = threading.Thread(target=write_power, args=(p,))
thread.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment