this idea will not work because we are checking pwm input continuously on both channel and according to yore code it will check only one condition, it will not check second condition therefore it measure only channel input. Correct me if I wrong.