def serial_send_and_receive(ser, theinput):
  """Write string to serial connection and return any response."""
  
  ser.write(b"2\n")
  
  try:
    state = ser.readline().decode('utf-8').rstrip()
  except:
    state = "empty"
        
  return state