Commit 4ffa868a authored by Alyx's avatar Alyx
Browse files

asdasd

:wq
parent 743564a9
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -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():
@@ -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