1 answer

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

Question:

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.


Answers

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]);
}

.

Similar Solved Questions

1 answer
How do you solve #28x ^ { 3} + ( 1- 3x ^ { 3} ) \geq ( x - 2) ^ { 3} + 35x ^ { 2}#?
How do you solve #28x ^ { 3} + ( 1- 3x ^ { 3} ) \geq ( x - 2) ^ { 3} + 35x ^ { 2}#?...
1 answer
Ensation polymerization Make models of a new monomer using the provided paper clips. Your new monomer...
ensation polymerization Make models of a new monomer using the provided paper clips. Your new monomer unit will be made from a combination of one regular paper clip and one colored paperclip. Make 4 total monomers, where each monomer unit represents a mole of that monomer. 2. Consider your monomer u...
1 answer
How many #cm^2# are there in #4.21*"inch"^2#?
How many #cm^2# are there in #4.21*"inch"^2#?...
1 answer
Previous Problem List Next (1 point) Find a set of vectors {u, v} in R4 that...
Previous Problem List Next (1 point) Find a set of vectors {u, v} in R4 that spans the solution set of the equations: x 5x - + y 2y + - W W = = 0 0 - Z u = V =...
1 answer
Ernie Grimaldi runs the Grimaldi Candy Company located in the town of Sibley. Ernie’s attitude toward...
Ernie Grimaldi runs the Grimaldi Candy Company located in the town of Sibley. Ernie’s attitude toward running the business leaves much to be desired. He believes in “flying by the seat of my pants.” He doesn’t believe in “wasting” time by sitting down and forming ...
1 answer
Hart Labs, Inc. provides mad cow disease testing for both state and federal governmental agricultural agencies....
Hart Labs, Inc. provides mad cow disease testing for both state and federal governmental agricultural agencies. Because the company’s customers are governmental agencies, prices are strictly regulated. Therefore, Hart Labs must constantly monitor and control its testing costs. Shown below are ...
1 answer
Student A believes that a missense mutation would lead to a nonfunctioning protein. Student B believes...
Student A believes that a missense mutation would lead to a nonfunctioning protein. Student B believes that the insertion of 3 nucleotides would be more likely to lead to a nonfunctioning protein. Student C disagrees with both student A and B claiming that such mutations would not alter the function...
1 answer
4. Unfortunately, we cannot change the type of muscle fibers we are born with, but we...
4. Unfortunately, we cannot change the type of muscle fibers we are born with, but we can still train all of the fibers we do have! Since most of us aren't superstar athletes, we can benefit from a good exercise routine that contains a bit of both types of exercise. o For those that naturally ha...
1 answer
Which financial instrument can not be purchased by commercial banks?
Which financial instrument can not be purchased by commercial banks?...
1 answer
If temperature were measured in J/molecule (which is what it measures) instead of Kelvin, what would...
If temperature were measured in J/molecule (which is what it measures) instead of Kelvin, what would be the value of K, Boltzmann's constant? 2/3 J/K 2/3 1.38 time 10^23 J/K 3/2 J/K...
1 answer
A 38.9 mL sample of a 0.486 M aqueous nitrous acid solution is titrated with a...
A 38.9 mL sample of a 0.486 M aqueous nitrous acid solution is titrated with a 0.400 M aqueous barium hydroxide solution. What is the pH after 7.85 mL of base have been added? pH =...
1 answer
Suppose that a random sample of 10 students in grade six was taken and the confidence...
suppose that a random sample of 10 students in grade six was taken and the confidence interval corresponding to their mean height (in inches) was found. the confidence interval was calculated to be (63.1, 65.3) with a known population standard deviation of 2.6 inches. what is the confidence level (a...
1 answer
2. (10 points) An ideal gas has a density of 2.765 g/L at 78.0 °C and...
2. (10 points) An ideal gas has a density of 2.765 g/L at 78.0 °C and 1180.0 mm Hg pressure. a. calculate the density of the gas at STP. b. determine the mass of gas in 500.0 mL container at STP...
1 answer
Could you explain how to reach 2,850,000 goodwill. Consolidated balance sheet DataCloud purchased all of the...
Could you explain how to reach 2,850,000 goodwill. Consolidated balance sheet DataCloud purchased all of the shares of Supercore for $30 million in cash. The balance sheets of DataCloud and Supercore just after the acquisition appear below, along with fair value information for Supercore's net a...
1 answer
What is the present value of the following series of payments: $112 made at the end...
What is the present value of the following series of payments: $112 made at the end of every year starting in year 1 and ending in year 19 EXCEPT there will be no payment of any kind at the end of year 14? The interest is 4.9% annual rate compounded annually....
1 answer
What is a trial balance and what are its purposes?
What is a trial balance and what are its purposes?...
1 answer
Proton and alpha particle released from rest
A proton and an alpha particle are released from rest when they are 0.225 nm apart. The alpha particle (a helium nucleus) has essentially four times the mass and twotimes the charge of a proton.a) Find the maximum speed of proton.b) Find the maximum speed of alpha particle.c) Find the maximum accele...
1 answer
3. Find the solution to the two-dimensional heat equation, ut = u -oo < ! < oo,-oo < y < oo) with...
3. Find the solution to the two-dimensional heat equation, ut = u -oo < ! < oo,-oo < y < oo) with initial data u(z,y, 0) = re- + uw İn the r-y plane (that is, 3. Find the solution to the two-dimensional heat equation, ut = u -oo...
1 answer
General Chemistry Mastering Chemistry
Which of the following substances would you expect to have a nonzero dipole moment? {rm NF_3} {rm CH_3NH_2} {rm XeF_2} {rm PCl_5}...