Controllig car led's with pwm

you could try something like this (untested)

const byte ledPin = 9;
const unsigned long period = 10000ul; // 10s in ms
void setup() {
  pinMode( ledPin, OUTPUT);
}

void loop() {
  analogWrite(ledPin, map(millis() % period, 0, period - 1, 0, 255));
}

% is the modulo operator, so millis() % period will always be between 0 and period-1 which you map to a brightness value of 0 to 255