Romi + Maestro compile error

Hi,
I am very new to use Romi and Pololu Maestro Servo Controller.
I tried to use Maestro to move Romi Robot Arm’s servo motor.
I made a program based on the sample program.
But my program is compile error.

Part of my program following:

#include <Servo.h>
#include <Romi32U4.h>
#include <PololuRPiSlave.h>
#include <PololuMaestro.h>
#ifdef SERIAL_PORT_HARDWARE_OPEN
#define maestroSerial SERIAL_PORT_HARDWARE_OPEN
#else
#include <SoftwareSerial.h>
SoftwareSerial maestroSerial(0, 1);
#endif

MicroMaestro maestro(maestroSerial);

void setup()
{
maestroSerial.begin(9600);
}

And error following:

SoftwareSerial\SoftwareSerial.cpp.o: In function `__vector_9':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial/SoftwareSerial.cpp:306: multiple definition of `__vector_9'

Romi32U4\Romi32U4Encoders.cpp.o:D:\document\Arduino\libraries\Romi32U4/Romi32U4Encoders.cpp:27: first defined here

collect2: error: ld returned 1 exit status

I can’t solve this problem.

Could you help me?

Hello.

It looks like there is a conflict between Arduino’s SoftwareSerial library and the Romi32U4Encoders library. The Romi32U4Encoders library uses an ISR (interrupt service routine) for PCINT0_vect and so does the SoftwareSerial library, which explains the conflict. (We mention this compile-time conflict happening when using the Romi32U4Encoders library with other code that defines a pin-change ISR and an ISR for an external interrupt in the code comments in Romi32U4Encoders.h.) I was able to run your code without any errors (I had to add an empty loop() to make it compile successfully). What board do you have selected in your Arduino IDE and what version of the IDE are you using? I expect the ifdef block for setting the maestroSerial object to use the Romi 32U4’s hardware serial port.

By the way, you could alternatively remove the Maestro and try controlling the robot arm directly from the Romi 32U4’s control board using the Arduino’s Servo library. You can look at the “Controlling a servo” section in the Romi 32U4’s user’s guide for more details on how to set that up.

- Amanda

Hello,
Thank you for your reply.

I use Arduino IDE version 1.6.0 and the board uses Pololu A-Star 32U4.

The reason why Maestro is used is that it cannot be operated with three servomotors, two motors and six dry-cell batteries.
In order to separate the servomotor power supply, I think that it is necessary to control the servomotor by means other than Romi.

I was able to reproduce your error using version 1.6.0 of the Arduino IDE. Can you update to the latest version of the Arduino IDE and try recompiling your code again with the new version?

It sounds like you want to use the Maestro because of power concerns. Please note that you can still control all three servos and the motors using just the Romi 32U4’s control board and power each servo of the Romi 32U4’s robot arm separately.

- Amanda

Hello,
Updating the IDE to the latest version resolved the issue.
Thank you so mach.