My LED won't undim :(

Hi,

Did you use pin 9 as in the code?

What is the value of your LED current limit resistor?

Tom... :smiley::+1: :coffee: :australia:

Hi,
Please run this code and see what happens.

/*
   ON/OFF LED Tester
*/
byte PIN = 9;

void setup()
{
pinMode(9,OUTPUT);
}

void loop()
{
  digitalWrite(PIN,HIGH);
  delay(1000);
  digitalWrite(PIN,LOW);
  delay(1000);
}

Tom... :smiley: :+1: :coffee: :australia:

Hi,
Then try this code;

/*
   PWM LED Tester
*/
byte PIN = 9;

void setup()
{
pinMode(9,OUTPUT);
}

void loop()
{
  for (byte a = 0; a < 255; a++)
  {
    analogWrite(PIN, a);
    delay(5);
  }
  for (byte b = 255; b > 0; b--)
  {
    analogWrite(PIN, b);
    delay(5);
  }
}

thank you tom!

i tried running both codes, and the led still is dim.

but it's flickering on and off due to the delay.

what do you think is happening?

Hi, @flowersontrees

What is the value of your LED current limit resistor?

What are the coloured bands?

Tom... :smiley: :+1: :coffee: :australia:

Same weird things, also Elegoo Mega board, just half a day earlier: https://forum.arduino.cc/t/issues-with-simple-pwm/895147.
What is going on here ?

Elegoo has a download section on its site where the Arduino IDE can be downloaded ! That is terrible ! It is not even the newest version !
Always use the official website: https://www.arduino.cc/en/software.
What else could be wrong ? Bad bootloader ? Wrong pcb ?

Hi,
Strangerer and strangerer.
I await the reply to the series resistor question.

Tom.. :smiley: :+1: :coffee: :australia:


I upscaled the provided image. Maybe it can be made out from this.

Connect the LED and its current limiting resistor in series and apply 5V between the two ends with the appropriate ploarity. Does the LED light brightly ?

Please tell us the value, use your multimeter to measure it!
It's up to YOU to provide information, not US to try and work it out for you.

You've mistaken me for OP

Have you confirmed the LED is not in reverse? Have you confirmed it works by connecting it between 5V and GND?

Hi,

I tried likewise, but its one of those horrible type with a very bad body colour.
If it had been the old cream coloured body, even bad colour balance you could still get the value read correctly.

Tom.... :smiley: :+1: :coffee: :australia:

With a current limiting resistor in place

It was worth a shot.

Could be the led hot burned out. I would try the suggestion of just placing the LED on your 5v supply to ground with the resistor to see if it even turns on. This way we can eliminate the arduino.

hello fellow aussie! :australia:

i'm not too sure what exact resistor it is, but i took a photo:

thanks tom!

thank u paul!

i added ** to bold the code that i changed, to help you guys see it better.

but it turned into ** rather than bolding, and might've just confused everybody.

thank you!

definitely!
i want to provide you guys with as much info as possible

i'm afraid i don't have a multimeter (i'm still a newbie) in my elegoo kit.

is there another way i can help measure it?