Raspberry pi B+ has four hardware PWM. How to use them in C/C++. The less complicated solution - the better.
I found one working solution with WiringPi
gpio mode 1 pwm
gpio pwm-bal
gpio pwmr 1024
gpio pwm 1 500
This solution works only for one PWM output (GPIO18). I thinks it is because WiringPi is designed for previous version of raspberry pi (Model B+ has new PWMs on GPIO12, GPIO13 and GPIO19).
For controlling regular GPIO I found solution:
pi@auto:~$ sudo -i
root@auto:~# echo "16" > /sys/class/gpio/export
root@auto:~# echo "out" > /sys/class/gpio/gpio16/direction
root@auto:~# echo "1" > /sys/class/gpio/gpio16/value
root@auto:~# echo "0" > /sys/class/gpio/gpio16/value
But there is no way how to control hardware PWM.
Product https://www.pololu.com/product/2753 has reference to python library - that do exactly what I want.
Please no software PWM suggestions.
Thanks
Vlado