0% found this document useful (0 votes)
14 views

Data Communication and Computer Networks Project.

Uploaded by

buro
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Data Communication and Computer Networks Project.

Uploaded by

buro
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Unlocking secrets, connecting distant lands, and

preserving legacies, Morse code stands as a


timeless testament to the ingenuity of human
communication. Originating in the early 19th
century, this ingenious system of dots and dashes
has transcended generations, leaving an indelible
mark on history. In this captivating abstract, we
delve into the fascinating world of Morse code,
tracing its evolution from a simple telegraph
language to a symbol of resilience and
resourcefulness. From the tumultuous waves of
the seas to the silence of the skies, Morse code has
woven itself into the fabric of maritime, military,
and aviation communication, shaping the course
of human endeavors. But its influence extends far
beyond practical applications; Morse code has
inspired artists, sparked curiosity, and ignited the
imaginations of millions. Join us on a journey
through the dots and dashes, as we explore the
enduring legacy and enduring allure of Morse

MORSE CODE code in the ever-changing landscape of human


connection.

Prepared by- Aymen Abrar, Buro Elias,

PROJECT Efrata Elias, Kalab Zewdagegnew


Python program which produces the mores
code equivalent sound for a text given

import winsound
import time

# Morse code dictionary


morse_code_dict = {
'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-..', 'E': '.', 'F': '..-.', 'G': '--.', 'H': '....',
'I': '..', 'J': '.---', 'K': '-.-', 'L': '.-..', 'M': '--', 'N': '-.', 'O': '---', 'P': '.--.',
'Q': '--.-', 'R': '.-.', 'S': '...', 'T': '-', 'U': '..-', 'V': '...-', 'W': '.--', 'X': '-..-',
'Y': '-.--', 'Z': '--..', '1': '.----', '2': '..---', '3': '...--', '4': '....-', '5': '.....',
'6': '-....', '7': '--...', '8': '---..', '9': '----.', '0': '-----', ' ': '/'
}

def text_to_morse(text):
morse_code = ''
for char in text.upper():
if char in morse_code_dict:
morse_code += morse_code_dict[char] + ' '
else:
morse_code += '/ ' # For non-alphanumeric characters
return morse_code

def play_morse_code(morse_code):
dot_duration = 100 # milliseconds
dash_duration = 4 * dot_duration
gap_duration = dot_duration
word_gap_duration = 8 * dot_duration
for symbol in morse_code:
if symbol == '.':
winsound.Beep(440, dot_duration)
time.sleep(gap_duration / 1000)
elif symbol == '-':
winsound.Beep(440, dash_duration)
time.sleep(gap_duration / 1000)
elif symbol == '/':
time.sleep(word_gap_duration / 1000)
else:
time.sleep(gap_duration / 1000)

if __name__ == "__main__":
text = input("Enter the text to convert to Morse code: ")
morse_code = text_to_morse(text)
print("Morse Code:", morse_code)
play_morse_code(morse_code)
Below is a sample Paragraph

English:
Data communication is the process of exchanging information between two or more devices
through a transmission medium such as wires, cables, or wireless signals. It involves encoding
data into signals that can be transmitted and decoding them upon reception. This exchange
enables the transfer of text, images, audio, and video across various communication networks,
facilitating seamless connectivity and information sharing in our digital world.

Morse Code:
-.. .- - .- / -.-. --- -- -- ..- -. .. -.-. .- - .. --- -. / .. ... / - .... . / .--. .-. --- -.-. . ... ... / --- ..-. / . -..- -.-. .... .- -.
--. .. -. --. / .. -. ..-. --- .-. -- .- - .. --- -. / -... . - .-- . . -. / - .-- --- / --- .-. / -- --- .-. . / -.. . ...- .. -.-. . ... / -
.... .-. --- ..- --. .... / .- / - .-. .- -. ... -- .. ... ... .. --- -. / -- . -.. .. ..- -- / ... ..- -.-. .... / .- ... / .-- .. .-. . ... / /
-.-. .- -... .-.. . ... / / --- .-. / .-- .. .-. . .-.. . ... ... / ... .. --. -. .- .-.. ... / / .. - / .. -. ...- --- .-.. ...- . ... / . -. -.-.
--- -.. .. -. --. / -.. .- - .- / .. -. - --- / ... .. --. -. .- .-.. ... / - .... .- - / -.-. .- -. / -... . / - .-. .- -. ... -- .. - - . -.. /
.- -. -.. / -.. . -.-. --- -.. .. -. --. / - .... . -- / ..- .--. --- -. / .-. . -.-. . .--. - .. --- -. / / - .... .. ... / . -..- -.-. .... .-
-. --. . / . -. .- -... .-.. . ... / - .... . / - .-. .- -. ... ..-. . .-. / --- ..-. / - . -..- - / / .. -- .- --. . ... / / .- ..- -.. .. --- /
/ .- -. -.. / ...- .. -.. . --- / .- -.-. .-. --- ... ... / ...- .- .-. .. --- ..- ... / -.-. --- -- -- ..- -. .. -.-. .- - .. --- -. / -. . -
.-- --- .-. -.- ... / / ..-. .- -.-. .. .-.. .. - .- - .. -. --. / ... . .- -- .-.. . ... ... / -.-. --- -. -. . -.-. - .. ...- .. - -.-- / .- -.
-.. / .. -. ..-. --- .-. -- .- - .. --- -. / ... .... .- .-. .. -. --. / .. -. / --- ..- .-. / -.. .. --. .. - .- .-.. / .-- --- .-. .-.. -..

You might also like