1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/bin/python3 import serial import time def send_cmd(ser, delay, cmd): ser.write(f"{cmd}\n".encode("utf-8")) time.sleep(delay) def send_cmds(ser, cmds): for cmd in cmds: send_cmd(ser, cmd[0], cmd[1])