Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "functions.h"
- volatile uint16_t adcValue;
- int main(void)
- {
- SystemInit();
- GPIO_Leds_Init();
- TIM_Init();
- PWM_Init();
- ADC_MyInit();
- while(1)
- {
- TIM4->CCR1 = 2* adcValue;
- }
- }
- void ADC_IRQHandler(void){
- if(ADC_GetFlagStatus(ADC1, ADC_FLAG_EOC) == SET){
- adcValue = ADC1 -> DR;
- }
- ADC_ClearFlag(ADC1, ADC_FLAG_EOC);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement