aboutsummaryrefslogtreecommitdiffhomepage
path: root/Stomps/stomp_control.py
diff options
context:
space:
mode:
authorJudah Fuller <[email protected]>2024-06-15 14:28:21 +0100
committerGitHub <[email protected]>2024-06-15 14:28:21 +0100
commit1b0601a8be5deecf3dd27eff6213ac7359d9761c (patch)
treeb07c12ff2e4b56b0a46c26732ff9067a756cb670 /Stomps/stomp_control.py
parent21a4119966e79645c60159548d700d19926f0505 (diff)
parent3ba4308938bcab5a23ae96b0809895ef28d47720 (diff)
downloadOpenCortex-1b0601a8be5deecf3dd27eff6213ac7359d9761c.tar.gz
OpenCortex-1b0601a8be5deecf3dd27eff6213ac7359d9761c.zip
Merge branch 'main' into patch-1
Diffstat (limited to 'Stomps/stomp_control.py')
-rw-r--r--Stomps/stomp_control.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Stomps/stomp_control.py b/Stomps/stomp_control.py
new file mode 100644
index 0000000..86aae20
--- /dev/null
+++ b/Stomps/stomp_control.py
@@ -0,0 +1,16 @@
+# Code copied to be easy to use as one script
+from stomp import StompCommand
+
+def switch_stomp(selected_stomp):
+ with open('/dev/zencoder/knob_stomp' + str(selected_stomp), 'wb') as file:
+ press_command = StompCommand("button", "pressed")
+ file.write(press_command.raw_bytes)
+ release_command = StompCommand("button", "released")
+ file.write(release_command.raw_bytes)
+
+if __name__ == "__main__":
+ while True:
+ selected_stomp = int(input("Enter a stomp between 1 and 11: "))
+ if(selected_stomp > 0 and selected_stomp < 12):
+ print "Switching stomp " + str(selected_stomp)
+ switch_stomp(selected_stomp) \ No newline at end of file