Loading player_functions.py +12 −12 Original line number Diff line number Diff line Loading @@ -15,6 +15,18 @@ display = serial.Serial("/dev/ttyUSB0", 19200, serial.EIGHTBITS, serial.PARITY_N threading.Thread(target=serial_listener).start() def serial_listener(): while True: # Read one byte from the serial port data = display.read() # Decode the byte to a string received_char = data.decode('utf-8') # Check if the received character is 'E' if received_char == 'E': if (proc.poll() is not None): proc.terminate() # Find the ID of the first MIDI device since I only have one def findAMIDIDevice(): Loading Loading @@ -98,18 +110,6 @@ def playTrack(track_path, port): return def serial_listener(): while True: # Read one byte from the serial port data = display.read() # Decode the byte to a string received_char = data.decode('utf-8') # Check if the received character is 'E' if received_char == 'E': if (proc.poll() is not None): proc.terminate() # Get a random thing from the music folder Loading Loading
player_functions.py +12 −12 Original line number Diff line number Diff line Loading @@ -15,6 +15,18 @@ display = serial.Serial("/dev/ttyUSB0", 19200, serial.EIGHTBITS, serial.PARITY_N threading.Thread(target=serial_listener).start() def serial_listener(): while True: # Read one byte from the serial port data = display.read() # Decode the byte to a string received_char = data.decode('utf-8') # Check if the received character is 'E' if received_char == 'E': if (proc.poll() is not None): proc.terminate() # Find the ID of the first MIDI device since I only have one def findAMIDIDevice(): Loading Loading @@ -98,18 +110,6 @@ def playTrack(track_path, port): return def serial_listener(): while True: # Read one byte from the serial port data = display.read() # Decode the byte to a string received_char = data.decode('utf-8') # Check if the received character is 'E' if received_char == 'E': if (proc.poll() is not None): proc.terminate() # Get a random thing from the music folder Loading