hello,
with my Raspi 2B I need to control at least 2 motors simultaneously by identical pwm (plugged to a L298 H Bridge), but I could find only 1 pwm pin on the GPIO header:
how to do it then?
I like pigpio.BMS Doug wrote:PIGPIO will give you hardware timed PWM on any GPIO pin.
I've heard that they can, I only have experience of gettingPWM working with PIGPIO, I've never tried servoblaster and not tried PWM with WiringPi.PiGraham wrote:I like pigpio.BMS Doug wrote:PIGPIO will give you hardware timed PWM on any GPIO pin.
Other DMA based gpio libraries can also provide stable PWM on any pin. AFAIK WiringPi and ServoBlaster can also do that.
Have a read of the PIGPIO documentation but as I read it you can set the PWM rate up to 40000Hz and achieve up to 20000 step resolution.davenull wrote:@ Laurens: there will be 2 different pwm signals needed, for a robot differential drive.
@ Doug: I am currently fine with pwm frequencies on my Arduinos so far (via analogWrite(0-255) - not quite sure, something like 1-4 kHz perhaps)
- which frequency/resolution will provide pigpio (or wiringPi )?
Yes, pigpio is compatible with wiringPi.davenull wrote:thank you very much, yes, I think 800 Hz will be fine, and I am using C (actually g++) !
BTW,
as you are the API author:
will pigpio be compatible then when I am also using wiringPi API functions for different purposes (not pwm) in the same program, simultaneously?
(e.g., delay, digitalWrite, analogRead, wiringSerial ?)