I'm currently developing an application with the WiringPi library. I have implemented a prototype in Python, and I'm currently trying to reproduce the same behaviour in C++. However, I ran into some issues.
In Python, I have the following code related to PWM:
p1 = GPIO.PWM(25, 1000) p2 = GPIO.PWM(21, 1000) p1.start(100) p2.start(100) ...(some code)... p1.ChangeDutyCycle(50) p2.ChangeDutyCycle(50)
I'm trying to replicate the same behaviour with the WiringPi library in C++, but I can't find how to do it. I tried using the Software PWM Library (included in WiringPi, see here) without any success. Please note that softPwmCreate(...) returns 0 (which means success):
softPwmCreate(25, 100, 100); softPwmCreate(21, 100, 100); ...(some code)... softPwmWrite(25, 50); softPwmWrite(21, 50);
Can anyone tell me what I'm doing wrong, and how I could use the WiringPi library to replicate my Python code?