Using energia software Write a program for your MSP430 board to will perform the following three tasks:...

Free

80.2K

Verified Solution

Question

Electrical Engineering

Using energia software

Write a program for your MSP430 board to will perform thefollowing three tasks: 1. Input: Take a character string as userinput through the serial interface. 2. Processing: Convert theentire string to lower case, and 3. Output: Return the processedstring to serial output, which will be displayed on your computermonitor. Example: If the input character string is, “Here I am”,the output should be, “here i am”. For serial input and outputpurpose, you should use the serial monitor feature of the Energia.Note: After completing your homework, make a video of your workwith verbal explanations. Make sure your face is seen in the video.If your LaunchPad or Serial Monitor is not responsive when the TAcomes to check your homework, show the TA your video.

Answer & Explanation Solved by verified expert
4.3 Ratings (852 Votes)


char* serialString()
{
static char str[21]; // For strings of max length=20
if (!Serial.available()) return NULL;
delay(64); // wait for all characters to arrive
memset(str,0,sizeof(str)); // clear str
byte count=0;
while (Serial.available())
{
    char c=Serial.read();
    if (c>=32 && count     {
      str[count]=c;
      count++;
    }
}
str[count]='\0'; // make it a zero terminated string
return str;
}

void setup() {
Serial.begin(9600);
}

void loop()
{
static boolean needPrompt=true;
String userInput;
if (needPrompt)
{
    Serial.print(\"Please enter inputs and press enter at the end:\n\");
    needPrompt=false;
}
userInput= serialString();
if (userInput!=NULL)
{
    Serial.print(\"You entered: \");
    Serial.println(userInput);
    Serial.println();
    userInput.toLowerCase();
    Serial.print(\"You Lower case String: \");
    Serial.println(userInput);
    Serial.println();
    needPrompt=true;
}
}


Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students