Simple Arduino to Arduino serial communication

I know how to move data back and forth from Aduino and Monitor.

Now moving to running a 2 Duemilanovas and want to exchange info between them. Want to also interact with monitor on at least one.

So I guess I need to use serial0 and 1. Tried the sketch called Multiserialmega. But the compiler gives an error on Serial1.begin.

Does my Arduino have a serial1? Looks like it does on data sheet.

Should the sketch work? Any other suggestions?

The Duemilanova has only one hardware serial port so you need to use a software serial, I think you should use software for the least critical. I presume that would be the serial monitor?

Anyways, if you need more hardware USARTs you need to get the Mega :slight_smile: [I'm sure there are other models with more than one USART, I'm just too lazy to google it for you now :)]

Start here...

.. but as you read it, imagine yourself connecting a 2nd Arduino in place of the LCD controller.

Then have a look at...

Yup, read the sheepdog stuff. Helpful but didn't get me all the way there.

Created code with s/w serial. Works great so far. Should do the trick.

One question though- sw serial read looks like it could hang forever if it doesn't get anything. ie: it waits forever. I don't think there is a way to get control back from it ie: I don't think you can have a deadman timer to resuce it. Am I wrong?

There is no way to querie with the s/w serial is there? This is only available with h/w serial right?

Software Serial has a very specifc set of available calls. More limited than h/w serial. available() isn't one of them.

I tried it just for the heck of it and got a complier error saying available() is not a part of the library.

Code is working fine but I assume it will wait forever (until a reset) to recover if no data is present.

Sounds like a good idea. Unfortunately I'm pretty new to this stuff and haven't yet figured out how to write a function and put it in a library so it'll have to wait unitl I get a little more experience under my belt. :-/

Also the serial commands all point to the UART so can't see how I would do it without interfering with h/w serial, which I am using to communicate with the monitor at the same time. .

If it is really that simple, if you paste something here. I'll try it and see if it works...

Good news is: the

A major reason to use NEWsoftserial is the fact that is has an "available" function.

I've heard about it but wasn't sure where to find it and how to get it into my library. Was a pc of cake.

For anyone who needs it.
Here's the link- NewSoftSerial | Arduiniana

Got it now and will play w/it.