Question: Write a program for the microcontroller that flashes the Morse code pattern of a string. The Morse code isa system used to transmit characters and
Write a program for the microcontroller that flashes the Morse code pattern of a string. The Morse code isa system used to transmit characters and numbers through light or sound signals. Each character is mapped to a series of dots and dashes as shown below. For example, the letter A is (dot-dash), the letterB is (dash-dot-dot-dot) etc. To show a Morse letter on the microcontroller, the LED blinks for a short duration to represent a dot or for a long duration to represent a dash.

The link below shows the microcontroller flashing the message SOS, which stands for Save Our Shipand is a universal distress signal.
https://youtu.be/o6tGN0_JXMk
In the video, the LED flashes the message SOS. It shows three quick flashes (letter S), followed by three long flashes (letter O), then three short flashes (letter S). After a pause, the message is flashed again,in an infinite loop. The green light indicates the message is about to restart.
MessageS: dot-dot-dotO: dash-dash-dashS: dot-dot-dot
These are the timing rules. The unit should be a small duration that you choose.
?The length of a dot is one unit (1x)
?A dash is three units (3x)
?The space between a dot and a dash within a letter is one unit (1x)
?The space between letters within a word is three units (3x)
?The space between words is seven units (7x)
First, translate the two messages at the links below. What strings did you get?
Message 1:https://youtu.be/AWtsLwc0Tw4- 2 -
Message 2:https://youtu.be/X8c_DC-sJ5o
Your code should declare a string as below at the top of the code.
char str[] = Go Knights;
?Your code should work for any string (you are not required to handle numbers in the string).
?Your code should discover the size of the string and flash all the words.
?The only change to the code to make it flash a different message is by putting a new message between the quotes.
?To test your program, flash a few messages and submit the link to the video with your code.
?Your code should flash the message in an infinite loop.
?Flash the green light once when the message is about to restart.
?Store all the dot-dash pattern in a 2D array. The array has 36 rows (26 letter and 0-to-9 digits).
1234567890 UVWXYZ ABCDEFGH-JK L M N O P QRST 1234567890 UVWXYZ ABCDEFGH-JK L M N O P QRST
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
