LED dimming incrementally by motion sensor imput

I'm trying to get an LED to get brighter every time a presence is sensed by a motion detector incrementally. One person goes by adds to the brightness of the led and let's say after 20ppl the LED is at 255.

so far my code is;

int timer = 500;
int SensorValue =0;
int SensorPin = 0;
int ledPin = 11; //LED connected to digital pin 11 PWM for dimming
int ledValue = 0;
int i;

void setup() {
  Serial.begin (9600);
  pinMode (ledPin, OUTPUT);
  pinMode (SensorPin, INPUT);
  delay(2000);//it takes the sensor 2seconds to scan the area around it
}
void loop() {
  SensorValue=analogRead(SensorPin);
  if (SensorValue <800){
    digitalWrite(11, ledValue);
  }
  delay(timer);
  Serial.println (SensorValue);
  delay(1000);
}
void Dimup() {
  ledValue=ledValue+5;
  for (int i=0; i <=255; i +10){
    digitalWrite(11, ledValue);
  }
}

As of now first, the led turns on right off the bat. so no dimming happens.
But if anyone out there knows what the trouble is or how this could be figured out i'd really appreciate it!
cheers

You want to use analogWrite, not digitalWrite. Look at the Analog--> Fading example in the IDE. Digital is either on or off, Analog can be many values.