I am trying to send serial data one way from a one arduino to a second one (master/slave setup). I have a few problems:
-
What I gather from reading some of the other serial data posts is that arduino #1 rx connects to arduino #2 tx.....and #1 tx connects to #2 rx.
I also assume they need to share a ground. Am I correct in this thinking or do they also need to share power? -
Also, I don't understand the code syntax to send serial data from #1 to #2 and how to receive that data in #2. I can read my pot input in #1, but then don't know how to send it.
Do I need to designate
int rxPin = 0;
int txPin = 1;
and then in void setup()
void setup()
{
Serial.begin(9600); // ...set up the serial ouput in 0004 format
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
}
in my code? This seems logical to me, but I'm not sure.
- Lastly, do i send my pot data using the following syntax?
Serial.print(dataFromPot);
and how do i receive this in #2?
Seriously a simple thing, but can't find a tutorial to walk me through this step by step (hardware + software).
Thanks!!!!
Lynn