PiPHP / GPIO

A PHP library for accessing the GPIO pins on a Raspberry Pi.
MIT License
425 stars 43 forks source link

How to use PWM ? #18

Closed alcalyn closed 3 years ago

alcalyn commented 6 years ago

I didn't found any PWM support in this library, how do you achieve this ?

erikaheidi commented 6 years ago

+1 to that question! I've been wondering how to use PWM with this library.

AndrewCarterUK commented 6 years ago

This library uses the sysfs driver for controlling the GPIO pins, and this driver doesn't support PWM.

I'd suggest using a library such as phpi as it uses different kernel interfaces to control the pins and can thus support PWM.

Sorry!

AndrewCarterUK commented 6 years ago

It does seem like there is a possible approach that uses a driver similar to the sysfs driver.

If anyone reading this wants to have a crack at PiPHP/PWM - I'd be more than happy to support.

AndrewCarterUK commented 6 years ago

I've set up a PiPHP/PWM repo that people can fork from if they want to play around with this as a project.

I've stripped it down to a single pin class, and you can see most of the important changes in this diff.

svpernova09 commented 3 years ago

Seems like this has been resolved via https://github.com/piphp/pwm.