A precursor to digital code was Morse Code. Morse Code was invented by the Samuel Morse, who unfortunately couldn't make it to his wife's funeral because of a delay in communication. He wanted to come up with a faster way to communicate rather than sending mail...and he did just that!
Morse code is a way of transmitting text information as a series of notes, lights, or clicks that can easily be understood by a skilled observer.
Use this link to better understand how Morse Code works!