receive data serially on command

hi!!

I am a beginner in arduino. I am controlling an arduino through i2c communication i.e when given command from the master the appropriate action is done by the slave.Now one of my command is to transmit data from the slave serially to the master which is connected to the pc and the received data is seen on the serial monitor.

The i2c commands works well but wen i connect the rx and tx of the arduino nothing works. and nothing comes on the serial monitor

Please help me out. thank you

What are you connecting the TX and RX to?

Please, post your codes using code tags (</>) for both I2C-Master and I2C-Slave.

i connected the tx of receiver to rx of sender and rx of receiver to tx of the sender.

That is useless information without knowing what the sender is, what the receiver is, and what else is connected where (like grounds).

Post a schematic, like a real engineer.

Post a schematic, like an real engineer.

Here it goes:
i2cFUno.png

1. Communication between SM1 (Serial Monitor 1) and UNO via UART Port.

2. Communication between UNO and NANO via I2C Bus.

3. Communication between NANO and SM2 (Serial Monitor 2) via UART Port.

i2cFUno.png

GolamMostafa:
Here it goes:

Your diagram is not helpful - just like @PaulS you can have no idea how the OP has things connected.

The purpose of @PaulS's question is to get the OP to post a diagram showing how s/he has everything connected in the expectation that it will help with diagnosing the problem.

Answering questions that are addressed to newbies reduces their opportunity for learning.

...R

Robin2:
Your diagram is not helpful - just like @PaulS you can have no idea how the OP has things connected.

The purpose of @PaulS's question is to get the OP to post a diagram showing how s/he has everything connected in the expectation that it will help with diagnosing the problem.

Answering questions that are addressed to newbies reduces their opportunity for learning.

The answer might help/inspire OP to draw his own diagram/schematic and thus may enhance the opportunity of learning.

Look at the codes that the OP has posted in Post#3. It is an I2C Bus oriented codes (direct copy of someone else's post of another thread) within which he has inserted this UART code: Serial.readBytes(data, 20). If the OP could realize that the codes could not be mixed just at will, he would not certainly do it. The diagram of Post#5 along with the given 3 statements might help him to understand that he has made mistakes.

The answer might help/inspire OP to draw his own diagram/schematic and thus may enhance the opportunity of learning.

Then make it clear that that is your intent. Stop pretending to answer for the OP. It's way beyond old.

Then make it clear that that is your intent. Stop pretending to answer for the OP. It's way beyond old.

This is an open Forum; interaction-actions could come from any corner?

GolamMostafa:
This is an open Forum; interaction-actions could come from any corner?

Interaction is not the same thing as help.

Help is welcome from any corner.

Interaction that is not help is just confusing noise - especially if the person asking for help is inexperienced.

...R

Interaction that is not help is just confusing noise - especially if the person asking for help is inexperienced.

That's your perception!

GolamMostafa:
That's your perception!

It's not his exclusively. It's a widely shared view.

PaulS:
That is useless information without knowing what the sender is, what the receiver is, and what else is connected where (like grounds).

Post a schematic, like a real engineer.

Whom have you addressed to post a schematic? Is is the OP or anyone who is a registered member of this Forum? I am a registered member of this Forum.

GolamMostafa:
Whom have you addressed to post a schematic? Is is the OP or anyone who is a registered member of this Forum? I am a registered member of this Forum.

I think the fact that I quoted a portion of a previous thread, and made comments, strongly implies that the comments are address to the person that I'm quoting.

Just as you quoted part of what I wrote suggests that you are addressing your question to a specific forum member, not all forum members.

Your schematic might reflect how the OP should have connected stuff, but it does not tell us anything about how OP ACTUALLY connected stuff. Or meant to. It was, therefore, just noise, as you did not suggest, imply, or even hint at the fact that it might not actually reflect anything about OPs circuit.

PaulS:
I think the fact that I quoted a portion of a previous thread, and made comments, strongly implies that the comments are address to the person that I'm quoting.

When you say 'strongly implies', then there is a 'Schrödinger Tunnel' which I have simply utilized? I understand that there is a difference between the following two quotes when someone is strict/serious?

PaulS:
I think the fact that I quoted a portion of a previous thread, and made comments, strongly implies that the comments are address to the person that I'm quoting.

and

I think the fact that I quoted a portion of a previous thread, and made comments, strongly implies that the comments are address to the person that I'm quoting.

There is a difference between the following two quotes when someone is strict/serious?

Not to me.

I think I should suggest to the Moderators to move everything starting with Reply #5 to a separate Thread so that @GolamMostafa can pursue his enquiries without mucking up the Thread that was started by @malamsthu.

...R