First draft of code is written, there are no errors, but I could not test if it actually works because I did not have permission to open the com port.