Attempt to modularise the serial to handle Pi and Windows OS