At My Fingertips

Morse Code

Long before the Internet it was possible to communicate digitally across long distances! This was done using electrical telegraph systems.

Samuel Morse (a painter! -- and inventor), together with Joseph Henry (the scientist who invented the precursor of the electric doorbell, and the namesake for the unit of electrical inductance, H) and Alfred Vail (a machinist and inventor), contributed to the development of a telegraph system that uses two kinds of marks: "dots" (represented by short lines on paper) and "dashes" (longer lines).

Each character (letter or number) is represented by a sequence of dots and dashes. Frequent characters use few marks (the "e" uses a single dot, the "t" uses a single dash), less frequent characters use more marks.

Ultimately, the Morse code was standardized by the International Telecommunications Union (ITU).

Morse Code

The following table shows the letters and numbers in ITU Morse code:

Morse Code

Loading...

Measurements

The measurements are all multiples of some unit.

  • Dot: 1 unit
  • Dash: 3 units
  • Space between marks: 1 unit
  • Space between characters: 3 units
  • Space between words: 7 units

In our implementation, methods have a parameter to specify the size of a unit.

Use the hgap function to produce a gap of a desired width.

Loading...
Loading...

Encode

Now let's encode some text into Morse code!

A single character

Loading...

A single word

Loading...

Multiple words

Loading...

This activity has been created by LuCE Research Lab and is licensed under CC BY-SA 4.0.

Morse Code

Logo of PyTamaro

PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI

Privacy PolicyPlatform Version c3a8286 (Mon, 14 Oct 2024 13:30:28 GMT)