Wigwag (more formally, aerial telegraphy) is an historical form of flag signaling that passes messages by waving a single flag. It differs from flag semaphore in that it uses one flag rather than two, and the symbols for each letter are represented by the motion of the flag rather than its position. The larger flag and its motion allow messages to be read over greater distances than semaphore. Messages could be sent at night using torches instead of flags.
The most common code used with wigwag had three motions, only two of which were needed to form letters of the alphabet. These two were waving the flag, respectively, to the left and right – the wigwagging motion. A character was formed by sequentially displaying a number of motions (elements). Like Morse code, the number of elements in each character was not fixed, the most common letters being assigned the shortest codes. A number of other codes were used at times, some of them with a fixed number of elements and up to four different motions. Morse code was used with wigwag after it became an international standard.
The wigwag system was invented in the 1850s by US Army surgeon Albert J. Myer who became the first Chief Signal Officer of the US Army in command of the Signal Corps. Wigwag was used extensively by both sides in the American Civil War, where it was an essential adjunct to electrical telegraphy, and continued to see use in both America and Europe until the end of the century. After that, long-distance communication was performed by electrical telegraphy, or in some places where the telegraph was not available, by heliograph. This communication system was in use with the US Navy until the twentieth century.