User manual

Tutorial Program
2015 Microchip Technology Inc. DS40001812A-page 31
3. LED Dimming
Both the Complementary Output Generator (COG) and Analog-to-Digital Converter
(ADC) modules are implemented in this mode. The COG produces a pulse-width
modulated output whose duty cycle is determined by the measured ADC value across
the R25 potentiometer. The COG output controls the brightness of the D6, D7 and D8
LEDs.
FIGURE 3-6: LED DIMMING DISPLAY
Turning the potentiometer clockwise increases the brightness of the LEDs while
rotating it counterclockwise dims the LEDs.
FIGURE 3-7: LED DIMMING
Exiting this mode by pressing S1 brings the program back to Voltmeter.
3.2 SOURCE CODE AND DATA SHEETS
The tutorial program is available on the Microchip web site:
(www.microchip.com/explorer8)
The source codes and hex files are contained in the
Explorer_8_Demo_MCC.X
project file.
For information on reprogramming the device with new or modified code, see
Section 2.3 “Programming the Microcontrollers”.