Question: EMBEDDE OS, LINUX UBUNTU, BEAGLEBONE BLACK Develop a user space program that will flash the BeagleBoneled to represent a word provided to the program in
EMBEDDE OS, LINUX UBUNTU, BEAGLEBONE BLACK
Develop a user space program that will flash the BeagleBoneled to represent a word provided to the program in Morse Code.
> MCode -w Welcome would flash the led to indicate Welcome in Morse Code
Find the file McodeMod.c to build your BBB application you must use at least two files main.c and McodeMod.c to create Mcode.
File McodeMod.c :
#define CQ_DEFAULT 0
/* the empty string, follwed by 26 letter codes, followed by the 10 numeral codes, followed by the comma,
period, and question mark. */
char *morse_code[40] = {"",
".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",
".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",
".--","-..-","-.--","--..","-----",".----","..---","...--","....-",
".....","-....","--...","---..","----.","--..--","-.-.-.","..--.."};
inline char * mcodestring(int asciicode)
{
char *mc; // this is the mapping from the ASCII code into the mcodearray of strings.
if (asciicode > 122) // Past 'z'
mc = morse_code[CQ_DEFAULT];
else if (asciicode > 96) // Upper Case
mc = morse_code[asciicode - 96];
else if (asciicode > 90) // uncoded punctuation
mc = morse_code[CQ_DEFAULT];
else if (asciicode > 64) // Lower Case
mc = morse_code[asciicode - 64];
else if (asciicode == 63) // Question Mark
mc = morse_code[39]; // 36 + 3
else if (asciicode > 57) // uncoded punctuation
mc = morse_code[CQ_DEFAULT];
else if (asciicode > 47) // Numeral
mc = morse_code[asciicode - 21]; // 27 + (asciicode - 48)
else if (asciicode == 46) // Period
mc = morse_code[38]; // 36 + 2
else if (asciicode == 44) // Comma
mc = morse_code[37]; // 36 + 1
else
mc = morse_code[CQ_DEFAULT];
return mc;
}
Convert the Morse Code program into a BBB Device Driver and write a user program to use the driver. The Driver must support multi-user access to its resources.
Please submit the source code for the driver and user application, make file and evidence that it worked.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
