PololuRPiSlave + LSM6

I am writing a sketch for a Balboa robot.

When I try to build a sketch that includes both PololuRPiSlave.h and LSM6.h I get a compile error:

libraries\Wire\utility\twi.c.o (symbol from plugin): In function `twi_init’:

(.text+0x0): multiple definition of `__vector_36’

libraries\PololuRPiSlave\PololuTWISlave.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Pololu A-Star 32U4.

I imagine it’s because they both use I2C. Is there a way to make these work together?

Hello.

Just to be absolutely clear, you are using a Balboa robot, correct, and not a Romi 32U4 Control Board? If you have the Balboa robot, you should be using the Balboa32U4 library. (Some of the library’s examples use the LSM6 library and the LIS3MDL library.)

The Raspberry Pi slave library for Arduino, which is designed for the Romi 32U4 Control Board, cannot work with the LSM6 library because it use the Wire library. With the slave library, the Raspberry Pi is the I2C master, not the AVR, so you would need to read the sensor directly from the Raspberry Pi. We do not have any examples for interfacing with the Romi’s on-board LSM6DS33 sensor with a Raspberry Pi, however, you might find this post helpful.

- Amanda

Ah okay. That makes sense. I use the RasPi as the master device to communicate with all I2C devices and then pass that information around. I think I can work with that. I’ll check the other post for hints and tips.