diff options
author | Judah Fuller <[email protected]> | 2024-06-15 14:28:21 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-06-15 14:28:21 +0100 |
commit | 1b0601a8be5deecf3dd27eff6213ac7359d9761c (patch) | |
tree | b07c12ff2e4b56b0a46c26732ff9067a756cb670 /Stomps/stomp_scroll.py | |
parent | 21a4119966e79645c60159548d700d19926f0505 (diff) | |
parent | 3ba4308938bcab5a23ae96b0809895ef28d47720 (diff) | |
download | OpenCortex-1b0601a8be5deecf3dd27eff6213ac7359d9761c.tar.gz OpenCortex-1b0601a8be5deecf3dd27eff6213ac7359d9761c.zip |
Merge branch 'main' into patch-1
Diffstat (limited to 'Stomps/stomp_scroll.py')
-rw-r--r-- | Stomps/stomp_scroll.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Stomps/stomp_scroll.py b/Stomps/stomp_scroll.py new file mode 100644 index 0000000..c10ddd2 --- /dev/null +++ b/Stomps/stomp_scroll.py @@ -0,0 +1,23 @@ +from stomp import StompCommand + +# Open knob_stomp1 to 11, listen for numeric input and switch on input +dev_file_names = [] +for i in range(1,12): + dev_file_names.append('/dev/zencoder/knob_stomp' + str(i)) + +def switch_stomp(selected_stomp): + with open(dev_file_names[selected_stomp-1], '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) + +selected_stomp = 1 +while True: + if(selected_stomp > 0 and selected_stomp < 10): + if selected_stomp != 5: + print "Switching stomp " + str(selected_stomp) + switch_stomp(selected_stomp) + selected_stomp = selected_stomp + 1 + else: + selected_stomp = 1
\ No newline at end of file |