Page 1 of 1

Retrieve the PWN value

Posted: 03 Nov 2023, 00:48
by mackowiakp
I have a sensor with PWM output.
At the moment I am using a ready-made module on an operational amplifier and reading the measured value using ADC.
But are there any modules that would allow reading the pulse width in digital form?

Re: Retrieve the PWN value

Posted: 03 Nov 2023, 08:16
by TD-er
You mean like [Plugin#GPIO#Pinstate#N] (with N being the GPIO nr) but then for the PWM value as a state?

I just looked at the code and it doesn't work like that, but I guess we could add it as a feature.
Not sure whether it should be called "pinstate" or "pwmstate".

Re: Retrieve the PWN value

Posted: 03 Nov 2023, 08:32
by Ath
It's supposed to return the PWM value for pins set to PWM output... :?

Edit: See the docs

Re: Retrieve the PWN value

Posted: 03 Nov 2023, 09:15
by TD-er
It might work... but processing the function also tries to read the pin state and not sure what this will do to the PWM which is running.