Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Tera Term Terminal Emulator In this part of the Lab 4, you will set up the Tera

ID: 3800919 • Letter: T

Question

Tera Term Terminal Emulator

In this part of the Lab 4, you will set up the Tera Term terminal emulator.

Follow the steps given “Introduction to Tera Term Terminal Emulator" to set up Tera Term terminal emulator.

#include "mbed.h"

Serial pc(USBTX, USBRX);

int main() {    

pc.printf("Hello World! ");    

while (1){        

pc.putc(pc.getc()+0);
    }

})

Modify the code from above to do the following:

Display "Hello World!" and then go on to the beginning of the next line

When the user type the following paragraph, the same will be displayed on the screen.

      abcdefg

      hijklmn

      opqrst

      uvwxyz

Note: after each line the user will use "Enter" key of the keyboard to start a new line.

Explanation / Answer

the code needs to modified very slightly

int main()

{

pc.printf("Hello World ")

while(1)

{

pc.getc();

pc.putc(stdout);

}

}

stdout in putc indicates the return of value in print to standard output

and

as new line is also a character putc method accepts it as an input and since it is a non-prntable character it just leads to a new line

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote