I'm using Joan's great pigpio library to read two DHT sensors on a Pi to register in- and outside temperature of my greenhouse. The next step is to add some PWM outputs to operate a couple of fans. I've looked through the functions and I'm sure this is perfectly possible. (And of course I'm not considering to connect the fan directly to the IO port. )
The question I have is whether there is an off the shelf executable (or source C-file) to perform this function like the DHTXX code I'm using for the sensors? Something where you enter the GPIO port number and the desired PWM ratio on the command line and off it goes until you change the setting.
Unfortunately I'm not that much of a C-adept and I don't feel like tinkering with this for too long. It is a standard function that I'm sure others have implemented already. Any hints are welcome!