Hello everyone,
I have one question regarding reading value from the optical sensor, it is not quite a trouble as I would like for you to give me advice about the best approach to this issue. I used ADC hardware oversampling with the rate of 64x. And after that again I use the median value of 10 values read from ADC and use that the median to check whether it is above some value (for example 1500 (ADC)->0.6V) and according to read value is above or below that border value I generated frequency output. Now in testing borderline cases I got signals in the images. In this cases, I'm not sure my approach is good. Maybe to use fixed value as a border for signal on and off is wrong. What do you think? Maybe some different approach in the calculation if the signal is on or off.