Hello. I am trying to use the Pololu library within the Arduino environment, on an ATMega328P. Since Arduino uses C libraries and because theres an ATMega328P version of the Pololu library which uses the same C header format, I set out thinking this should be relatively trivial. However, I’ve had no luck in getting an Arduino ‘sketch’ to use the Pololu library. Specifically, I need to use the wheel encoders library with a ATMega328P.
Unpacking *.o and *.h files to /usr/share/arduino/hardware/libraries/pololu (and deleting them from everywhere else, to be sure) does get the Arduino environment ‘seeing’, and trying to compile, the library. In the case of importing encoders.h, then using compiling encoders_init(7,8,9,10), I receive the following error:
undefined reference to 'encoders_init(unsigned char, unsigned char, unsigned char, unsigned char)' /tmp/build5757683369907846729.tmp/core.a(HardwareSerial.cpp.o): In function `global constructors keyed to rx_buffer': /usr/share/arduino/hardware/cores/arduino/HardwareSerial.cpp:114: multiple definition of `__vector_18' hardware/libraries/Pololu/OrangutanSerial.o:/home/darkmoon/Programming/libpololu-avr/devices/atmega328p/../../src/OrangutanSerial/../../src/OrangutanSerial/OrangutanSerial.cpp:58: first defined here o: In function `main': undefined reference to `encoders_init(unsigned char, unsigned char, unsigned char, unsigned char)'
The reference to OrangutanSerial.cpp tells me that this library is dependant on the Orangutan specific serial library and that its therefore not going to be a trivial task to get the Pololu library working under Arduino.
I assume this means I need to grab the sourcecode for the encoder functions and set about rewriting them under Arduino. While I work on this, if anyone knows a shorter solution, I’d obviously be very happy to hear of it