Arduino MEGA

Was just checking out the new Arduino Mega.

When useing the 4 serial ports, How do you control which port is writen to / read from when useing Serial.read() and Serial.print()? Or does it effect all 4 ports at the same time?

Also, is it possible to set the different ports to different speeds?

I think the ports will be bound to four individual objects, and thus, it will be possible to have different baudrates.

I think the ports will be bound to four individual objects, and thus, it will be possible to have different baudrates.

That sounds great, but the referance lib doesn't show anything new for the serial, so I am wondering how we will keep them apart - or am I over looking something - or is the referance not up to date yet?

Just found:

#if defined(__AVR_ATmega1280__)
extern HardwareSerial Serial1;
extern HardwareSerial Serial2;
extern HardwareSerial Serial3;
#endif

Inside hardware/cores/arduino/HardwareSerial.h

Which can be used like:

Serial.begin(BAUD_1);
Serial1.begin(BAUD_2);
Serial2.begin(BAUD_3);
Serial3.begin(BAUD_4);

:slight_smile:

Thats what I missed - Thanks

EDIT
Well I thought, but I can't find it in the referance. Is there a link?

Well I thought, but I can't find it in the reference. Is there a link?

Come on it's software, reference documentation always lags code release, check back in a few months.

Now in hardware we just use blue wire changes and forget the references all together :wink:

Lefty

...in hardware we just use blue wire changes and forget the references all together :wink:

;D That made my day!

Now in hardware we just use blue wire changes and forget the references all together

I've seen PCBs with the ECO (engineering change order) numbers up to about 10 or 15 silkscreened on the board. AS the boards got updated, the latest number would get circled.

-j