Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • For a single blink in LED, I'm getting multiple 800+ values. I want them to count as a single value until it drops below 800. So, the counter will increase by 1 if the values cross 800 until it drops below 800 again. So, I wanted to know if there is any way to make this as a range code where all the values will count as 1. Commented Nov 11, 2020 at 10:16
  • Exactly what I did above if you print count on the serial monitor you will see that count increases each time your value goes above 800. If you want to reset it just add else: count = 0 and count will reset to zero as soon as your value goes below 800 Commented Nov 12, 2020 at 14:28
  • look, for a single blink i'm getting multiple 800+ values. if i , use for ( values >800){ counter++;} my counter increases by 6-7 at a time for a single blink. using this condition because of multiple 800+ values it increases counter by a lot for a single blink. and I don't want that. i want to increase that by 1. i couldn't think about anything that would solve this. you can refer to my question. i have added serial monitor output. Commented Nov 12, 2020 at 16:46