There's a sort of code with whistles on the water and in the wilderness, but only the emergency signal is recognized universally, at least across North America. The signal for distress is three whistles.
People seem to disagree about what one and two whistles mean, but you can negotiate this with your group to keep communication clear. You can use one whistle for "STOP!" and two for "GET OVER HERE!", but I've also heard one whistle being used for "Hey, where are you?" and a one whistle response just to indicate generally where you are.
You can signal distress in Morse code using light or a whistle. The universal distress signal is an "SOS": · · · – – – · · ·
Where dots are short flashes/bursts, and dashes are longer ones.