r/ArduinoHelp • u/VinMega6468 • 23d ago
Why does this not work?
solved
when i click simulate nothing happens and the leds dont light up can anyone help
9
Upvotes
r/ArduinoHelp • u/VinMega6468 • 23d ago
when i click simulate nothing happens and the leds dont light up can anyone help
View all comments
Show parent comment
2
u/gm310509 22d ago •
Actually it is good practice to give them names.
That said, I wouldn't count
digital_pin_7as a good name, but it is the best practice.In this case, better names would be something like:
IMHO those are better names as they describe the purpose. Then later in the code when you see something like this:
it is pretty reasonable to assume that they will turn the red LED on - or if it doesn't, at some point that was the intention, but something has changed and not been propagated through the program fully (a.k.a. a risk factor for the introduction of bugs).
Now I get that this is a small program and none of the above is that big of an issue, but as programs get larger it can become one.
That is why it is a best practice.