LED emits low light when using randomSeed.

I'm a beginner in Arduino and I came across this while I was familiarizing with the codes and functions. As the title says, when I use randomSeed, LEDs emits low light. Per LED, I series 1kOhm limitting resistor. I tried to change it with a lower value (In some forums they said 100 Ohms is the recommended minimum value, tried it but still gets the same result). I tried also to change the LEDs to know if they are faulty, but it seems that they are not the problem. Then I tried another sketch I found on the internet utilizing the random() function. this is the code:

int ledRed = 2;
int ledGreen = 3;
int ledYellow = 4;
int ledBlack = 5;
 
void setup() {
  Serial.begin(9600);
  pinMode(ledRed, OUTPUT);
  pinMode(ledGreen, OUTPUT);
  pinMode(ledYellow, OUTPUT);  
  pinMode(ledBlack, OUTPUT);
}
 
void loop() {
  Serial.println(random(5));
  digitalWrite(ledRed, random(5));
  digitalWrite(ledGreen, random(5));
  digitalWrite(ledYellow, random(5));
  digitalWrite(ledBlack, random(5));
  
  delay(1000);
}

The LEDs then light up normaly, emitting its normal light intensity. What could be the problem? Thanks in advance for the help.

random(5)

Returns a number from zero to four.

How about

random(256)

Which will return a number between zero and 255 inclusive.

Plus, you want

analogWrite(pin, random(256));

Where did you randomSeed?

What's a black led do?

I see no call to randomSeed. You are clearly not talking about the code you posted.

Here's the code. The ledBlack is just a variable. Random name only sorry.

long randNumber;

void setup()
{
  pinMode(randNumber,OUTPUT);
  Serial.begin(9600);
  randomSeed(analogRead(0));
}

void loop()
{
  int randNumber = random(7,12);
  digitalWrite(randNumber,HIGH);
  delay(500);
  digitalWrite(randNumber,LOW);
}

Pins are INPUT by default. An LED on an INPUT pin will not be very bright.

So I should first set my 8-11 pins as OUTPUT on setup() for them to light up bright?

PaulS:
Pins are INPUT by default. An LED on an INPUT pin will not be very bright.

That did it. Thanks for the help good sir.

you may want to try your original sketch, but like this:

int ledRed = 2;
int ledGreen = 3;
int ledYellow = 4;
int ledBlack = 5;
 
void setup() {
  Serial.begin(9600);
  pinMode(ledRed, OUTPUT);
  pinMode(ledGreen, OUTPUT);
  pinMode(ledYellow, OUTPUT);  
  pinMode(ledBlack, OUTPUT);
}
 
void loop() {
  Serial.println(random(0,2));
  digitalWrite(ledRed, random(0,2));
  digitalWrite(ledGreen, random(0,2));
  digitalWrite(ledYellow, random(0,2));
  digitalWrite(ledBlack, random(0,2));
  delay(1000);
}