Script to test serial function