usbtoggle/relay
2026-07-11 00:31:10 +02:00

3 lines
230 B
Shell
Executable file

#!/bin/bash
[ $# -ne 1 ] || [ "$1" != "0" -a "$1" != "1" ] && { echo "Usage: relay 0|1"; exit 1; }
python3 -c "import serial; s=serial.Serial('/dev/cu.usbserial-2110',115200,timeout=2); s.write(b'$1'); print(s.read(10).decode())"