Used a function from StackOverflow to handle cross-thread marshalling of the data read from Arduino