LED activation on reduced voltage

Hello I am looking to write code that will activate an led when the voltage on a Potentiometer is reduced.

Arduino Examples\03.Analog\AnalogInput

Comparator