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.

6
  • 2
    ledPin4 == HIGH? Guess you mean something else. Commented Aug 18, 2016 at 6:25
  • Also, currentMillis = onTime * 100; makes little sense. What did you actually mean? Commented Aug 18, 2016 at 6:29
  • @EdgarBonet I put it in there so if the LED was HIGH and there button pushed it would end the timer in the while loop Commented Aug 18, 2016 at 6:30
  • @MikaelPatel I set the LED to HIGH and then used an if statement to check if it's HIGH and the button was pressed at the same time. I didn't use there == to assign the HIGH state Commented Aug 18, 2016 at 6:33
  • 1
    Then you mean currentMillis = previousMillis + onTime, but that won't work because you assign currentMillis = millis(); right after. Instead, you can simply break out of the while loop. Commented Aug 18, 2016 at 6:52