flyte / mqtt-io

Expose GPIO modules (Raspberry Pi, Beaglebone, PCF8754, PiFace2 etc.) and digital sensors (LM75 etc.) to an MQTT server for remote control and monitoring.
MIT License
460 stars 157 forks source link

PWM #4

Open dr-apple opened 7 years ago

dr-apple commented 7 years ago

Hello,

it works all very good, thanks for your script...

Could you still install PWM for all GPIO?

flyte commented 7 years ago

I certainly can. I'll have a think about how to implement it and get it done when I've got a little time to spare.

dr-apple commented 7 years ago

Perfectly thank you, you can also times times whether you can speed up the input of an input? It takes about 1 second until the change is recognized :-( This is too slow at a pushbutton ....

flyte commented 7 years ago

Yep, it's on the list - see #5 :)

Gr4ffy commented 3 years ago

Hi, Great job @flyte Is PWM implemented already?

flyte commented 3 years ago

Hey @Gr4ffy thanks!

It's currently not implemented I'm afraid. There's no technical reason why it couldn't be, just not enough time in the day 😊

Gr4ffy commented 3 years ago

Got it, thanks for the feedback.

bosu1787 commented 2 years ago

no pwm yet?

matthijskooijman commented 1 year ago

I am also in need of PWM, so I was looking at implementing this, but I'm not sure what the best approach is. I'm not sure if I'll be able to find the time to actually implement this, but in the interest of moving this forward, here are some considerations I had while looking at the code for this. Feedback is welcome.

kc2zgu commented 1 month ago

I think the /sys/class/pwm interface makes the most sense (instead of trying to write several drivers for specific hardware when there is already a common API in the kernel), and to be a dedicated module that doesn't try to figure out things like mappings that may not even exist between regular GPIO pins and PWM pins. Just rely on the user to determine which PWM chip and line they want to use and have the driver loaded. I've used this interface from C before, all you have to do it write the pin number to the export file (like the old sysfs gpio), set the frequency/period with period, write 1 to enable, and write a number to duty_cycle to set the pulse length.