led lights 12 volts flickers :o

int led = 9;           // the PWM pin the LED is attached to
int brightness;    // how bright the LED is
void setup() 
{
  pinMode(led, OUTPUT);
}

void loop() 
{
  for (brightness = 0; brightness < 256; brightness ++)
  {
    analogWrite(led, brightness);
    delay(30);
  }
  
  for (brightness = 254; brightness > 0; brightness --)
  {
    analogWrite(led, brightness);
    delay(30);
  }
}