Question

Using the Arduino IDE, write a program for an Arduino board that will perform the following three...

Using the Arduino IDE, write a program for an Arduino board that will perform the following three tasks:

1. Input: Prompt the user to enter a character string. Read the character string from your computer through the Arduino's serial interface.

2. Processing: Convert lowercase characters to uppercase and uppercase characters to lowercase, and

3. Output: Return the processed string through the serial output and display it on your computer screen.

Example: If the input character string is, “Here I am”, the output should be, “hERE i AM”. For serial input and output purposes, you should use the serial monitor.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

char inst[100],outst[100],a;
int i=0,j=0;
void setup() {
Serial.begin(9600);
displayinputstring();
displayoutputstring();
}

void loop() {
if(Serial.available()>0) {
a=Serial.read();
inst[i++]=a;
if(isLowerCase(a)){
int b=int(a)-32;
outst[j++]=char(b);
}
else {
int b=int(a)+32;
outst[j++]=char(b);
}
}
}

void displayoutputstring()
{
for(int k=0;k<j;k++)
Serial.print(outst[i]);
}

void displayinputstring()
{
for(int k=0;k<i;k++)
Serial.print(inst[i]);
}

Add a comment
Know the answer?
Add Answer to:
Using the Arduino IDE, write a program for an Arduino board that will perform the following three...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Looking for help to create the arduino program for this in C. dont need the breadboard...

    Looking for help to create the arduino program for this in C. dont need the breadboard information just the arduino code to run it all, and as an expection to handle a case where a letter not 'g' or 's' to send output invalid response and not stop the exection of the blinking based You are to create a new application that will execute on your Arduino platform upon the Blink example that is available in the Arduino Examples folder...

  • Prompt the user to enter two character strings. The program will then create a new string...

    Prompt the user to enter two character strings. The program will then create a new string which has the string that appears second, alphabetically, appended to the end of the string that shows up first alphabetically. Use a dash (-') to separate the two strings. You must implement the function string appendStrings(string, string), where the return value is the combined string. Display the newly created string. Your program must be able to handle both uppercase and lowercase characters. You are...

  • To be turned in You will write a program that will do the following: Prompt the...

    To be turned in You will write a program that will do the following: Prompt the user to enter any character form the keyboard. You will compute some statistic concerning the type of characters entered. You will keep reading characters until a 'Q' is entered. The 'Q' should not be included when computing the statistics properties of the input. Example input: $8mJ0*5/I+Nx1@3qc2XQ We are interested in determining the following statistics: The number of alphabets The number of uppercase letters The...

  • Very difficult and confusing assignment for C++ need help! Write a program that prompts a user...

    Very difficult and confusing assignment for C++ need help! Write a program that prompts a user to enter a line of text (including whitespace). Please use string object NOT C-string, a string library can be included. 1. Convert the input into uppercase and output the string to the screen. 2. Get the first and the last characters then appends the line with "I Love C++" and output the string to the screen. Example: Input: Hello, How are you? Output 1:...

  • 10. replaceSubstring Function Write a function named replaceSubstring. The function should accept three C-string or string...

    10. replaceSubstring Function Write a function named replaceSubstring. The function should accept three C-string or string object arguments. Let's call them string1, string2, and string3. It should search string for all occurrences of string2. When it finds an occurrence of Programming Challenges string2, it should replace it with string. For example, suppose the three arguments have the following values: stringt: "the dog jumped over the fence" string 2 "the" string3: "that" With these three arguments, the function would return a...

  • 2. Searching a String: Write a MIPS assembly language program to do the following: Read a...

    2. Searching a String: Write a MIPS assembly language program to do the following: Read a string and store it in memory. Limit the string length to 100 characters. Then, ask the user to enter a character. Search and count the number of occurrences of the character in the string. The search is not case sensitive. Lowercase and uppercase letters should be equal. Then ask the user to enter a string of two characters. Search and count the number of...

  • Write an LC-3 program (starting at memory location 0x3000) to take a string as input and...

    Write an LC-3 program (starting at memory location 0x3000) to take a string as input and then output information about this string. The end of the string will be denoted with the "#" character. Once the "#" has been found, output the following in order: 1) The letter “u” followed by the number of uppercase letters in the string (A-Z) 2) The letter “l” followed by the number of lowercase letters in the string (a-z) 3) The letter “n” followed...

  • ‘C’ programming language question Write a MENU DRIVEN program to A) Count the number of vowels...

    ‘C’ programming language question Write a MENU DRIVEN program to A) Count the number of vowels in the string B) Count the number of consonants in the string C) Convert the string to uppercase D) Convert the string to lowercase E) Display the current string X) Exit the program The program should start with a user prompt to enter a string, and let them type it in. Then the menu would be displayed. User may enter option in small case...

  • Write a program(Python language for the following three questions), with comments, to do the following:   ...

    Write a program(Python language for the following three questions), with comments, to do the following:    Ask the user to enter an alphabetic string and assign the input to a variable str1. Print str1. Check if str1 is valid, i.e. consists of only alphabetic characters. If str1 is valid Print “<str1> is a valid string.” If the first character of str1 is uppercase, print the entire string in uppercase, with a suitable message. If the first character of str1 is...

  • C Program In this assignment you'll write a program that encrypts the alphabetic letters in a...

    C Program In this assignment you'll write a program that encrypts the alphabetic letters in a file using the Vigenère cipher. Your program will take two command line parameters containing the names of the file storing the encryption key and the file to be encrypted. The program must generate output to the console (terminal) screen as specified below. Command Line Parameters Your program must compile and run from the command line. The program executable must be named “vigenere” (all lower...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT