diff options
Diffstat (limited to 'Stomps/read_stomp.py')
-rw-r--r-- | Stomps/read_stomp.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Stomps/read_stomp.py b/Stomps/read_stomp.py new file mode 100644 index 0000000..d1ff7f0 --- /dev/null +++ b/Stomps/read_stomp.py @@ -0,0 +1,18 @@ +# Quick and simple Python 2 script to read the raw bytes, +# from a stomp device on the Quad Cortex. + +from stomp import StompEvent + +with open('/dev/zencoder/knob_stomp2', 'rb') as file: + byte_buffer = [] + while True: + byte = file.read(1) + if not byte: + break + + byte_buffer.append(byte) + if len(byte_buffer) is 32: + event = StompEvent(byte_buffer) + print event + event.print_bytes() + byte_buffer = []
\ No newline at end of file |