Exemple #1
0
from SerialPort import SerialPort
from time import sleep


com = SerialPort('COM6', timeout=5)

com.sendMsg('12 01 01 FF')
sleep(3)
com.sendMsg('05 14 2B 37 39 32 31 38 36 37 31 39 39 37 00 00 00 00 00 00 00 00 FF')

# Wait UP batton
com.waitMsg()
com.sendMsg('1F 01 01 FF')
#sleep(3)
com.sendMsg('04 01 01 FF')
Exemple #2
0
from SerialPort import SerialPort


com = SerialPort('COM6', timeout=1)

com.waitMsg()
com.sendMsg('01 02 00 01 FF')
com.waitMsg()
com.sendMsg('01 02 00 01 FF')
com.waitMsg()
com.sendMsg('22 22 07 30 30 32 34 30 34 31 39 66 66 63 64 00 45 37 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF')

while True:
    com.waitMsg()