One way around the problem of getting a fast response from a microcontroller is to move the problem away from the processor. In the case of the Pi's processor there are some built-in devices that can ...
The big problem in using the PWM driver is in avoiding opening and closing files, which is a slow operation. A better idea is to implement a class that can work with the driver without closing the ...