Writing to serial port