What am i doing wrong?
Some questions.
int reading = analogRead(photocellPin);
What is reading?
int pitch = 780-reading;
Where did the 780 come from? What is pitch?
int ledwaarde = map(reading,400,797,255,0);
ledwaarde = constrain (ledwaarde, 0, 255);
What is ledwaarde?
You need a current limiting resistor for the LED.