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*

5
  • I could compile your code just fine. No compiler errors. Though it's not that useful to define the pins as constants inside setup and loop. Just use global variables. Commented Apr 18, 2019 at 22:14
  • So the problem is not compilation but uploading. Have you chosen the correct COM port? Commented Apr 18, 2019 at 22:22
  • 1
    I believe so. It only lists one port "COM4(Arduino/Genuino Uno". Commented Apr 18, 2019 at 22:23
  • 1
    You also have logic errors in your code. You have if (led5 == HIGH), which will NOT check the state of the LEDs pin, but will compare the LEDs pin number, which is constant 4 here, to HIGH, which is defined as 1. This is always false. You have to do a digitalRead(led5) Commented Apr 18, 2019 at 22:23
  • Thank you for your help. I went through and changed all the logical errors. l5=digitalRead(led5); if (l1 == HIGH) { digitalWrite(led1, LOW); It doesn't have any issues from what I can tell other than it not uploading so I believe it is an issue with my computer now. Again thank you so much. Commented Apr 18, 2019 at 23:16