Controlling LED w/ Proximity Sensor

Nailed it! Thank you!

I added another IF statement that changes brightness to 0/off if the distance is above a certain distance or at 0.