Needing help as a beginner

Hello Community

Our teacher has given us an assignment but I am not sure where to start.

We have to make a code that will read the serial monitor, and when we type a certain word, it will respond with another word. So when I type "Tick", it should fire back "Tock"

Is there someone willing to help?

Thanks in advance,

Mike

Our teacher has given us an assignment

What part of that didn't you understand?

What coding have you already mastered?

.

I am completely new, so I know to begin with

Serial.begin(9600);

but I don't know what to do in the void loop

Suggest you try some of the basic sketches that come in the IDE examples.

.

Well, the assignment will wait then...

Another teacher handing out assignments without teaching students the information needed to achieve the goal. Imagine that.

Mikebau5:
Is there someone willing to help?

Have you tried your teacher?

What sort of teacher would give you an assignment like this without teaching programming and Arduino hardware for at least three months.
Leo..

very basic summary.

void setup is the place where you setup your stuff. declare the pins, instantiate stuff, etc.
it is also where you place the code you want it to run only at the start.

void loop is the main program. as the name suggests, this function keeps repeating itself. this is also the place where the program 'waits' for input, so to say.

there are several sketches online, as well as under arduino ide > file > example > communications
though i would recommend online.

if u need a direction, u can try Serial.available() and Serial.read.

good luck out there.

@Mikebau5, do some reading.
Serial Input Basics
Serial Print

DangerToMyself:
Another teacher handing out assignments without teaching students the information needed to achieve the goal. Imagine that.

Wawa:
What sort of teacher would give you an assignment like this without teaching programming and Arduino hardware for at least three months.
Leo..

[devils advocate]
Teacher: "You'll find everything you need on the 'net, just Google it"
[/devils advocate]

The serial input basics thread was already mentioned. Example 2 can be applicable, else example 3.

Once newData is true, you can process the received characters. To compare text, you can use strcmp; it will return 0 if the two strings match. If there is a match, you can send a desired text back to the pc using the already mentioned serial.println.

kenwood120s:
[devils advocate]

There are certainly some lousy teachers. But if it was the teacher that was at fault I would expect more than one request for help.

...R