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*

6
  • 1
    An error with the code you show: setFlag is not defined. Also, some of the closing braces aren't indented in the code as shown, and the last one isn't shown as part of the code block Commented Apr 8, 2017 at 13:35
  • @jwpat7 Sorry for the code I have edited this code now..check it. Up Commented Apr 8, 2017 at 14:44
  • And it will blink too fast to be visible. Commented Apr 8, 2017 at 14:54
  • @EdgarBonet add some delay() then problem will be solved Commented Apr 8, 2017 at 15:08
  • your code is a little bit too complicated. in the "if (flag)" portion of the code, flip the LED via "digitalWrite(LED, !digitalRead(LED));" and then clear the flag. No delay needed. Commented Apr 8, 2017 at 20:49