Skip to main content
added 6 characters in body
Source Link
Michel Keijzers
  • 13k
  • 7
  • 43
  • 59

The LDR sensor gives a range of values to show whether a LED is OFF/ON, let's say above LDR range 400, the led is ON. whenWhen a LED is ON, after reading the sensor values it shows above LDR range 800,because because the LDR sensor measuring in MS ms, Aa single LED blink shows six LDR 800+ values. Is there any way to count all the six LDR 800+ values to increase counter by 1.?

here'sHere's my output in serial monitor. 314 to 322 is led offOFF state and 816 to 851 is led ON state.

LED : 314
LED : 314
LED : 314
LED : 321
LED : 322
LED : 322
LED : 816
LED : 817
LED : 818
LED : 817
LED : 817
LED : 815
LED : 351
LED : 329
LED : 323
LED : 327
LED : 326
LED : 339

LDR sensor gives a range of values to show whether a LED is OFF/ON, let's say above LDR range 400 led is ON. when LED is ON, after reading the sensor values it shows above LDR range 800,because the LDR sensor measuring in MS , A single LED blink shows six LDR 800+ values. Is there any way to count all the six LDR 800+ values to increase counter by 1.

here's my output in serial monitor. 314 to 322 is led off state and 816 to 851 is led ON state.

LED : 314
LED : 314
LED : 314
LED : 321
LED : 322
LED : 322
LED : 816
LED : 817
LED : 818
LED : 817
LED : 817
LED : 815
LED : 351
LED : 329
LED : 323
LED : 327
LED : 326
LED : 339

The LDR sensor gives a range of values to show whether a LED is OFF/ON, let's say above LDR range 400, the led is ON. When a LED is ON, after reading the sensor values it shows above LDR range 800, because the LDR sensor measuring in ms, a single LED blink shows six LDR 800+ values. Is there any way to count all the six LDR 800+ values to increase counter by 1?

Here's my output in serial monitor. 314 to 322 is led OFF state and 816 to 851 is led ON state.

LED : 314
LED : 314
LED : 314
LED : 321
LED : 322
LED : 322
LED : 816
LED : 817
LED : 818
LED : 817
LED : 817
LED : 815
LED : 351
LED : 329
LED : 323
LED : 327
LED : 326
LED : 339
Source Link

Count specific range of output as 1 single output

LDR sensor gives a range of values to show whether a LED is OFF/ON, let's say above LDR range 400 led is ON. when LED is ON, after reading the sensor values it shows above LDR range 800,because the LDR sensor measuring in MS , A single LED blink shows six LDR 800+ values. Is there any way to count all the six LDR 800+ values to increase counter by 1.

here's my output in serial monitor. 314 to 322 is led off state and 816 to 851 is led ON state.

LED : 314
LED : 314
LED : 314
LED : 321
LED : 322
LED : 322
LED : 816
LED : 817
LED : 818
LED : 817
LED : 817
LED : 815
LED : 351
LED : 329
LED : 323
LED : 327
LED : 326
LED : 339