summaryrefslogtreecommitdiffstats
path: root/jds6600/control.py
diff options
context:
space:
mode:
Diffstat (limited to 'jds6600/control.py')
-rw-r--r--jds6600/control.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/jds6600/control.py b/jds6600/control.py
new file mode 100644
index 0000000..bf7b427
--- /dev/null
+++ b/jds6600/control.py
@@ -0,0 +1,8 @@
+class OpCode:
+ ONOFF = "w20"
+
+def sendCommand(opcode, args):
+ with open("/dev/ttyUSB0", "w") as tty:
+ print(f":{opcode}={args}.", end="\r\n", file=tty)
+
+sendCommand(OpCode.ONOFF, "1,0")