Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: AltSoftSerial and Servo libraries fails to compile

  1. #1
    Junior Member
    Join Date
    Nov 2015
    Location
    Suburb of Sydney, Australia
    Posts
    2

    AltSoftSerial and Servo libraries fails to compile

    I am using the robertsonics WAV Trigger board on a couple of different Arduinos. Until I added the Servo, all was working well compiling for both Uno and Nano. However, I now get error on compile (for source, see attachment):
    "
    Servo/Servo.cpp.o: In function `Servo::attached()':
    /usr/share/arduino/libraries/Servo/Servo.cpp:336: multiple definition of `__vector_11'
    AltSoftSerial/AltSoftSerial.cpp.o:/media/matt/2d3dp/sketchbook/libraries/AltSoftSerial/AltSoftSerial.cpp:92: first defined here
    collect2: error: ld returned 1 exit status
    "
    Looking at AltSoftSerial.cpp, I cannot see any reference to `__vector_11'. Have I left something important out, or is there really an internal conflict?

    DonationRobot.ino

    In anticipation of your assistance and any advice, thank you.
    Regards, RigTig181

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,444
    Quote Originally Posted by RigTig181 View Post
    or is there really an internal conflict?
    Yes, Arduino Uno & Nano have only one 16 bit timer. But Servo and AltSoftSerial need it. You simply can't use both, due to the hardware limits.

    If you step up to something like Teensy LC or 3.2, there are many timers and 3 real serial ports, so you can do much more without conflicts. There's also a lot more memory and the processor is faster, which also relieve the other painful limits you'd hit on Uno if things like the number of timers didn't stop you first.

  3. #3
    Junior Member
    Join Date
    Nov 2015
    Location
    Suburb of Sydney, Australia
    Posts
    2
    Many thanks to Paul for quick reply. To get the talking robot working quickly, all I did was change the interface to the robertsonics WAV Trigger board to use the hardware triggers. Each message is triggered by a separate logic pin, so uses only a digitalPin.write() to initiate the 4 messages. The only time-consuming part was synchronising the mouth movement with the sound, which was done by calling a routine to open the mouth to a given fraction for a specified time, and doing it lots of times. All went well on the day, and the talking robot got donations (as it asked for them).
    Thanks again to Paul. Obvious when I think about it, but the message was far too useless to make any sense to me at the time!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •