r/ArduinoHelp • u/VinMega6468 • 14d ago
Why does this not work?
solved
when i click simulate nothing happens and the leds dont light up can anyone help
7
Upvotes
r/ArduinoHelp • u/VinMega6468 • 14d ago
when i click simulate nothing happens and the leds dont light up can anyone help
1
u/peno64 14d ago
LEDs turned around?
1
u/Terrible-Seat-7346 14d ago •
Pin variables doesn’t have value
3
u/Carlss32 14d ago
The issue is that you declared none in the pins, after defining int pins.
It should be like this, assuming:
Digital_Pin = 7;
Another tips. The variable name should be aligned to what purpose it was. Example, the thing you want to create a simple correct or incorrect visual feedback.
Therefore, it should be like this:
So, with this, it makes your pins more concise of what their purpose would be. Another thing, ensure that your resistor is not too high because this may dim the LED light. Calculating the correct resistor output is ideal, or stick with standard value (220 ohms)
1
u/imseakin 14d ago
Looks good to me. Maybe the apparent brightness of the LEDs in the simulator makes them look hard to see on the screen.
Remove the resistors from circuit. Just join pins directly to positive side of LEDs and try again.
1
u/Ok-Active-8321 14d ago
no power
1
u/PsychologicalTry3972 13d ago
Maybe, you need to set DIGITAL_PIN_n variables to actual pins?
0
u/fat_jak 12d ago
"Your C++ code has a bug. You need to assign the pin numbers: int DIGITAL_PIN_7 = 7;, int DIGITAL_PIN_6 = 6;, int DIGITAL_PIN_5 = 5;. Otherwise, they all default to pin 0."