r/ArduinoHelp • • 29d ago

Why does this not work?

Post image

solved

when i click simulate nothing happens and the leds dont light up can anyone help

link: https://www.tinkercad.com/things/etCLO5FP0u8-traffic-light?sharecode=HVc9FlY7vOl6OchoP0UERVxlCc9BG0PDwAbMSnomTys

7 Upvotes

15 comments sorted by

View all comments

3

u/Carlss32 29d 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:

int correctLed = 2;
int inCorrectLed = 3;

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)