I have hit yet another issue with the new Mega R3.
Is there a good reason why only 8 servos are now supported by the Servo.h library? This is claimed by the example program, although the website info seems to be out of date and still claims that 48 are supported (Servo - Arduino Reference)
I find that servos number 9 and 10 glitch when turned on and then don't work at all when numbers 11 and 12 are added.
I was running 16 on the Mega R2 with exactly the same software. Is this a firmware change? Can I work around it? I don't want to use an alternative library if possible (I need the same delays etc).
If this can't be fixed, can anyone suggest a source for the old Mega R2s?
websitedragon:
Is there a good reason why only 8 servos are now supported by the Servo.h library? This is claimed by the example program,
Not sure why the comments in the Sweep example claim that only 8 servo objects can be created. The servo library sources indicate that it can run 12 servos per timer and the the 1280/2560 has four timers to spare. It creates an array of 48 servo objects.
Not sure why some of your servos aren't running well. Are you using any other libraries that might be using some timers?
Hmm... the mystery gets deeper then. I haven't got any other libraries running. This problem occurs even in the sweep example, with no other code added aside from more servos.
I don't know if it will make any difference but I'll try reloading the bootloader and messing around with the timers to see if I can give it a kick start.
I think the reference to 8 servos may be from the time when only 2 were supported on the UNO, if you look through the source code it supports many timers on the bigger chips and many servos on each of those timers - I think its 48 in total.
Just to let you know that I bought a new Arduino (another Mega R3) and it has worked just fine from the offset. Seeing as I haven't done anything funky with the first one, I presume it was broken when I received it. Boo.