ServoTimer2 library conflict with IDE 1.6.4? (now: Adavoice with servo?)

I dont usually go messing around with core files or class files with out specific directions..

while trying to use the ServoTimer2 library....(which I have used n the past, with older projects and hence older IDE versions without issue)..

I start getting these error at compile/upload time:

Arduino: 1.6.4 (Windows 7), Board: "Arduino Duemilanove or Diecimila, ATmega328"

Build options changed, rebuilding all

In file included from IM_servo_n_eye_n_sound_2.ino:17:0:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:117:14: error: conflicting declaration 'typedef bool boolean'
 typedef bool boolean;
              ^
In file included from IM_servo_n_eye_n_sound_2.ino:8:0:
C:\Users\username\Documents\Arduino\libraries\ServoTimer2/ServoTimer2.h:41:17: error: 'boolean' has a previous declaration as 'typedef uint8_t boolean'
 typedef uint8_t boolean;
                 ^
Error compiling.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

I would imagine it would be best to alter the ServoTimer2 library? vs some core IDE file?

But to what is best/suggested?

update: I tried the answer posted here:

http://forum.arduino.cc/index.php?topic=333961.0

but am now getting this error:

In file included from adavoice_servo_v1.ino:45:0:
C:\Users\username\Documents\Arduino\libraries\ServoTimer2/ServoTimer2.h:73:2: error: 'boolean' does not name a type
  boolean attached(); // return true if this servo is attached
  ^
C:\Users\username\Documents\Arduino\libraries\ServoTimer2/ServoTimer2.h:93:2: error: 'boolean' does not name a type
  boolean attached(int);   // return true if the servo on the given channel is attached
  ^
Error compiling.

update 2:

after reading another suggested fix here:

http://forum.arduino.cc/index.php?topic=252120.0

(change any reference of boolean to bool)..

  • and of course still having this line commented out:

//typedef uint8_t bool;

I am left with this now:

C:\Users\username\AppData\Local\Temp\build5716230445635923787.tmp\ServoTimer2\ServoTimer2.cpp.o: In function `__vector_9':
C:\Users\username\Documents\Arduino\libraries\ServoTimer2/ServoTimer2.cpp:25: multiple definition of `__vector_9'
C:\Users\username\AppData\Local\Temp\build5716230445635923787.tmp\adavoice_servo_v1.cpp.o:C:\Program Files (x86)\Arduino/adavoice_servo_v1.ino:507: first defined here
collect2.exe: error: ld returned 1 exit status
Error compiling.

not really sure what this one is suggesting the issue is?

I am trying to add a servo to a the Adafruit 'voice changer' tutorial/project: (which is working as expected)

https://learn.adafruit.com/assets/2215

I do a search for: "_vector_9" in both .cpp and.h files.. and nothing shows up/is found? (not sure why it is referencing TEMP directories either? (or build logs/files?)

anyone point me in the right direction?

thanks!

==========================

update:

Arrrghh..

I should have read the code comments better/closer.. :(

I see this now:

// WaveHC library already defines a Timer1 interrupt handler. Since we // want to use the stock library and not require a special fork, Timer2 // is used for a sample-playing interrupt here. As it's only an 8-bit // timer, a sizeable prescaler is used (32:1) to generate intervals // spanning the desired range (~4.8 KHz to ~19 KHz, or +/- 1 octave // from the sampling frequency). This does limit the available number // of speed 'steps' in between (about 79 total), but seems enough.

I thought I had read in another thread/post out there, that they had servos working with Adavoice? (maybe I mis-read?.. or there is some alternate way to achieve this?)

Side note:

has anyone ever gotten the Waveshield (WaveHC)... working with a Leonardo? or Pro-Micro yet?)

not really sure what this one is suggesting the issue is?

Two libraries that are being linked in use the same timer, and attempt to implement a handler for the timer interrupt. That won't work.

@PaulS -

Thank you for the reply..

As an alternate solution...

is there something you know of or can topic/chip you suggest I can do some searching on/for that will be 'more or less' like a servo shield or something? (something that is dedicated to running the servo, so the main Arduino board/Waveshield can continue to play audio and do the 'Adavoice' voice changing stuff

I dont want a a full blown 'shield' like the Adafruit servo shield.. something more SMD and very tiny if possible.

What kind of IC/set-up should I be looking for?

@PaulS or anyone for that matter. :)

I guess I'm looking for an I2C-controlled PWM driver with a built in clock type of IC/chip?

Looks like they (Adafruit) are using the: PCA9685 chip..

https://cdn-shop.adafruit.com/datasheets/PCA9685.pdf

I dont think I'd need '16' outputs... (although the components for their board seem to be minimal, maybe just re-create in a form factor more useful/appealing to me?)

Are there other chips of this nature but smaller I/O count? (maybe 4, 6 or 8 instead?)

Having never used these (or played around with I2C).. any 'negatives'? that I dont know about/should be aware of?

This more or less take the 'leg-work' away from the main Arduino board... correct?

I just send an 'I2C' command.. and forget about it?

I am trying to use this in conjunction with an Adafruit Waveshield...

which will be using Timer 1 -and- Timer 2....

so this is an attempt at a solution to get a '3rd' timer (so to speaker) to control some servos.. while the audio and voice changing is being done.

(all in a small/SMD form factor)

thanks for any feedback/suggestions.