Samuel F.B. Morse developed an electric telegraph (1832–35) and then invented, with his friend Alfred Vail, the Morse Code in 1838.