aboutsummaryrefslogtreecommitdiffstats
path: root/roles/serial/files/serial_macro.py
blob: eb4722697efd5801c738a74145ab8a234ae1931c (plain) (blame)
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])

remember that computers suck.