I want to use pwm pin to generate a square wave signal with duty cycle of 50%.
Simply, I wrote:
I want to read the output value to find when the signal change from 0 to 1.
I have tried to use the digitalRead function, but it doesn't work because I always get the value 0.
I want to get something about this:
The only case that digitalRead works is when the duty cycle is 100% or 0%, namely a constant signal.
Thanks in advance for any help.