Please read the forum sticky post to find out how to post code correctly, and edit your first post to fix it.
Sounds as if the sensor's output remains high for too long, even when you have adjusted it to the minimum setting. Right now, your code switches on the led as long as the sensor output is high. In fact, it switches the led on and off at high speed, too fast to see, dimming the led.
What you need your code to do is switch on the led when the sensor output changes from low to high. Then keep the led on for a short period, then switch the led off.