Go Down

Topic: Connecting 2 Duemilanove over Serial Port? (Read 1 time) previous topic - next topic

lwa223

Hi, I need to hook-up two Duemilanove 's so they "talk" with one another (i.e. a button is pressed on one, and an LED lights up on the other). I've tried reading into the master reader/master writer areas, but none seem to work. I'm assuming my code is fine for the moment but that my wiring is the problem. What would be the best way to hook up these boards?
Thanks :)

Grumpy_Mike

Quote
I've tried reading into the master reader/master writer areas

Not sure what that means. You will have to post the code and a schematic of how you are trying to wire them up.

However from the title of the post I guess you are trying to use the serial lines. I think you would be better off using the I2C lines. Make one arduino the master and the other the slave. Example code is already loaded into your computer under the file -> Examples -> Wire  menu.

lwa223

Pretty much, I've been using this http://www.arduino.cc/en/Tutorial/MasterReader

But, I'm mainly unsure of which wires to use to connect up. One tutorial says connect pins 4 and 5... another says connect the RX/TX pins... So I'm completely confused.

PaulS

Quote
Pretty much, I've been using this http://www.arduino.cc/en/Tutorial/MasterReader

Stick with one thing until you get it working/understand it.

Quote
But, I'm mainly unsure of which wires to use to connect up.

There is a schematic on that site that looks almost like a picture. How can you look at that and not know?

There's even code on that page to prove that it works.

lwa223

Yes, and I used that schematic. However, what I wanted to happen didn't happen. So, I've looked at various tutorials, though I haven't "tried" them out completely. So, I'm basically asking which do I connect?

PaulS

Quote
However, what I wanted to happen didn't happen.

That's a shame.

Now, if you were to describe which code you ran on each Arduino, what you expected to happen, and what actually did happen, we could offer more constructive responses.

lwa223

The code isn't my concern at the moment. What I want to do is light up an LED on one board by pressing a button attached to a breadboard attached to another Arduino. I just need to know whether to connect the boards through the 4/5 pins, as the tutorial suggests or through the RX/TX pins as other tutorials suggest. Once I know that, I'll come back an revisit the code if it doesn't work. No tutorial is giving me exactly what I want, so I'm unsure if the wire connections matter for exactly what you want to send... Or in the programming.
Thanks.

lwa223

Any advice or tutorial links would be extremely helpful ;)

wildbill

You are mixing up i2c communications with the standard serial port. You could indeed use the serial port(RX,TX) to have two arduinos talk to each other, but you'd lose the ability to use serial for debugging. Your tutorial, on the other hand, is all about i2c, which uses pins 4 & 5.

AWOL

Oh! Analogue pins 4 and 5!
Why didn't you say that?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

lwa223

So pins 4/5 would be best?

They basically do the same thing I'm assuming.

lwa223

Another, possible really dumb question... how do I view the serial window to make sure the program is working? If I just follow the tutorial I previously linked, I should see "hello" pop up or something, right?
I don't see anything, and I want to make sure I'm doing that right so I can experiment further.

Grumpy_Mike

Quote
They basically do the same thing I'm assuming.

No that is wrong. You are using I2C not the serial port so don't use TX & RX.

Quote
how do I view the serial window to make sure the program is working?

You connect the master arduino to the PC through the USB lead and open the serial window in the arduino environment.
You run only the code in that tutorial - no additions. You wire up pins 4 together, pins 5 together AND the grounds from each arduino together.

lwa223

I believe I did that, but no serial window words were appearing to me.  :~

Anyway, I didn't get that tutorial to work, but I managed to get it to work the way I wanted it after tweaking the code (How does that work??? :0)
But, thanks for everyone's help.

lwa223

Oh, and for anyone who happened to be having similar issues, or is just curious, I switched from the Master Reader/Slave Writer to the Master Writer/Slave Receiver tutorial... I think it worked better in this situation.

Go Up