I have a clone of the adafruit pwm expander for i2c bus and I note that they seem to use different libraries for running servos vs. fading leds. Can these boards do both simultaneously?
I have a need to move one servo back and forth while fading multiple leds (independently) on other channels. I'm just wondering if I have to hook the servo out some other way and just do leds on the expander.
This library is all you need need for both servos and LEDs. Set the frequency and then set the duty cycle (per pin) for both servo control and led fading.
Can these boards do both simultaneously?
No they can’t. It is fundamental to how the chip works. The solution is that the LEDs need to be inverted if they are to be run with a chip setup for servos. It is the fading up and down that has discontinues at the end.
I explain this in my Mulder article in the MagPi The MagPi issue 38 — The MagPi magazine
It is for the Raspberry Pi and in Python but the same applies for the Arduino and C++. The numbers you put in the chip’s registers are the same. And the schematic is identical if you wanted to make the same thing for an Arduino.
Forget libraries and just talk to the chip.