code to test the serial connection