Uno Pin 12, analogWrite values

Arduino Uno
Pin 12

I have three LED which share a common ground leg and have resistors on the ground leg. I don't remember the combination of resistors, but I did the calculations a while back to reduce the 5V signal. I am trying to use analogWrite to dim the green LED.
Analog write values below 130 will not light LED on Pin 12, 130 and above will light the LED.
LED on pin 10 and 11 will light dimly as I had hoped, but LED on pin12 does not light.

Is there a minimum value on the pin 12 analog write? Segment of Code controlling the LED below.

 if (temp >= (setpoint + .5))
    {
      digitalWrite(fan_low, HIGH);
      delay(250);
      digitalWrite(fan_med, HIGH);
      delay(250);
      digitalWrite(fan_high, HIGH);
      //delay(250);
      for (int i = 7; i < 10; i = i + 1)
      {
        digitalWrite (i, HIGH);
        delay (200);
      }
      //statepin9 = digitalRead(9);
      //if (statepin9 == HIGH)
      //{
        for (int i = 10; i < 13; i = i + 1)
        {
          analogWrite (i, 130);
          delay (200);
        }
        delay (400);
      //}
      for (int i = 13; i > 6; i = i - 1)
      {
        digitalWrite (i, LOW);
        delay (100);
      }
    }

thanks all!

Pin 12 on an Uno is not a PWM pin. The PWM pins are 3, 5, 6, 9, 10. 11.

Thanks! I read that in the documentation but when the LED still worked with analogWrite I wondered if the documentation could be wrong. What happens if I analogWrite to a non PWM pin? Will it damage the board?

No, it will not damage the pin. This is the part of the analogWrite() function that is executed when a pin is not a PWM capable pin.

case NOT_ON_TIMER:
			default:
				if (val < 128) {
					digitalWrite(pin, LOW);
				} else {
					digitalWrite(pin, HIGH);
				}

You mentioned the value 130, it should actually be 128.

Thank you! Luckily the LED I want to dim are only off by one pin, I'll look at reorganizing my outputs to shift those three LED onto the PWM pins so I can keep them in sequence.

Hi @sterretje,
so that you can learn a little more, I would like to know where I can find this information that you posted.
Tks.

Look for the file wiring_analog.c on your PC (or on the web).

For the AVR Arduino boards(Uno, Nano, Mega, etc.), find where the IDE is installed and follow this path:

... \Arduino 1.8.19\hardware\arduino\avr\cores\arduino

Then find the file wiring_analog.c. The code for all of the Arduino analog functions is in that file.

And, just FYI, the pin assignments can be found at:

... \Arduino 1.8.19\hardware\arduino\avr\variants\

Uno and Nano pins are in the standard folder.

@sterretje and @groundFungus
I found
tks

The ground pin on the LED must be connected to the ground directly, you must not connect a resistor in between. You need three resistors each one between the LED and Arduino output.
Otherwise you will find when the red LED is on, none of the other LEDs will work.

It is possible that the resistor is on the +5v side. It's been months since I soldered them in place. Whatever way I have them in place, the LED work individually. I just recently decided to see if I could dim the green LED - and learned they are plugged into the wrong pin position for PWM.

Yes I said that, but not together. Why is there any doubt? You have the hardware, so if you look at it you can tell if you have three resistors or just one, if you can count up to three.

Unfortunately this topic has digressed from the original question. The initial posters were very helpful. Nothing more needs to be added to this post.

Sorry I thought you wanted help about all your project including the hardware mistakes the others didn't pick up on.

I see I was wrong, so I will not answer your posts any more.
I wish you good luck with your attitude.