Maestro Micro and Arduino Mega 2560

Hello,
I use an Arduino Mega 2560 and a Pololu Micro Maestro with the PololuMaestro library.
My question is: Can I use a different hardware serial port to communicate with the Pololu Micro Maestro
as the default RX1 / TX1, because I need this port mandatory for other tasks?

Yours sincerely
kwalter

Hello.

It is possible to change the serial port that the Maestro uses. Are you using the Basic.ino file in the PololuMaestro library as an example? The SERIAL_PORT_HARDWARE_OPEN object in line 29 is an Arduino serial object that points to the first open Serial port on the Arduino. You could change line 29 to:

#define maestroSerial serial2 

This would use the TX2 and RX2 pins on the Arduino Mega 2560.

-Nathan

Nathan,

Thanks, this was very helpful. I couldn’t find this information anywhere else.
BTW, it should be: “#define maestroSerial Serial2” with a capital S on Serial2 or Serial3.

Thanks,
Brian

2 Likes

Sorry for digging-up an ancient post…but…

So, what was the solution to this? All I’m seeing is a blank box with no code.

I’m trying to use Serial2 and Serial3 to control a couple Micros, but can find no documentation on this as well as the OP. Serial0 and Serial1 are already taken, and I really don’t want to mess with those functions.

Hello, gr8sailor.

I am sorry you had trouble viewing the code in Nathan’s post; I edited it to make the code visible.

-Jon