AnsweredAssumed Answered

ADC Interrupt

Question asked by Utkarash Patil on Nov 10, 2017
Latest reply on Nov 10, 2017 by Utkarash Patil

I have used STM CubeMX and Keil u5 and i have interfaced a Potentiometer with Nucleo  STM32F103RB Devkit so i am getting  ADC Values using  these function,

  " HAL_ADC_Start_DMA(&hadc1,ui32ReadADCBuffer,3);

    ui32Pot1 = ui32ReadADCBuffer[0];

   ui32Pot2 = ui32ReadADCBuffer[1];

   ui32Pot3 = ui32ReadADCBuffer[2];  "

But Is there any way where i can read the ADC values only when the potentiometer(POT) is rotated means do we have any  callback fuction for it to interrupt the flow of code once the Potentiometer(POT)  values are changed

Like if intially the POT position is stable i will not read ADC values but when i rotate or change the POT value i should a callback or interrupt then i will perfor these instructions "

  " ui32Pot1 = ui32ReadADCBuffer[0];  ui32Pot2 = ui32ReadADCBuffer[1]; ui32Pot3 = ui32ReadADCBuffer[2];  "

I got one function but i am not able to get the exact use or functionality of that function please check with this function and also if there is any other way i can achieve the above told interrupt please let help me.