hello how can i convert the values i get from multiple ADC to multiple PWM signals again
Hello, I'm new to embedded system programming. I'm trying to turn 2 LEDs on and off with 2 potentiometers. But every time I turn a potentiometer, the LEDs flash at the same time. Can you help me with this?
void ADC_oku()
{
HAL_ADC_Start(&hadc1);
HAL_ADC_PollForConversion(&hadc1, 10);
adc0 = HAL_ADC_GetValue(&hadc1);
TIM2->CCR1 = (adc0<<4);
Adres0[0] =adc0 >> 4;
USBD_CUSTOM_HID_SendReport(&hUsbDeviceFS,Adres0,sizeof(Adres0));
}
void ADC_oku2()
{
HAL_ADC_PollForConversion(&hadc1, 20);
adc1 = HAL_ADC_GetValue(&hadc1);
TIM2->CCR2 = (adc1<<4);
Adres1[0] =adc1 >> 4;
USBD_CUSTOM_HID_SendReport(&hUsbDeviceFS,Adres1,sizeof(Adres1));
}