Skip to content

Control the PWM duty cycle with the conversion value of the ADC

Notifications You must be signed in to change notification settings

ALUIS97/PWM_ADC_LED_BRIGHTNESS_CONTROLL

Repository files navigation

PWM_ADC_LED_BRIGHTNESS_CONTROLL

Control the PWM duty cycle with the conversion value of the ADC

This code shows:

-How to use ADC in polling mode and get the converted value.

-How to set the ADC peripheral in continuos mode for a single channel conversion.

-How to use the TIMER 2 CHANNEL 1 to generate the PWM which changes the brightness of the LED.

-How to change the duty cycle in runtime and set the value in the comparator register.

NOTE: In this example we use a potentiometer to change the voltage input from 0 V to 3.3 V.

About

Control the PWM duty cycle with the conversion value of the ADC

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published