import time import serial ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=0.050) count = 0 while 1: ser.write(0xA0) time.sleep(0.5)