I have a PWM input in my raspberry pi GPIO. I only need to detect the time while the GPIO reads the PWM or not.
For example if my raspberry pi receive these (|||| => PWM)
_______|||||||_______||||||||______________|||||||_______
I will get the time of each low and PWM
_______|||||||_______||||||||______________|||||||_______
[70 ms][70 ms][70 ms][70 ms][ 140 ms ][70 ms][70 ms]
or at least be able to converted to a Voltage level High like these (---- => HIGH)
_______-------_______--------______________-------_______
[70 ms][70 ms][70 ms][70 ms][ 140 ms ][70 ms][70 ms]
I need it to be like that so I can get the time length of the PWM.
How can I do this in real time in python?