continous conversion of ADC and storing the data in memory card
Hi,
I am trying to store the converted data from ADC to memory card. as of now i can able to store the data and read the values of adc but when i tried to store the values of adc in memory card i could not able to do. i have used the below code.
I have mounted and declared objects related to sd card(FATFS) globally.
By using the below code i could only able to save the last value of adc but i would like to store every value of adc that has been converted since beginning to end ( till i stop).
I presumed as i have declared adc in interrupt mode after every conversion of adc it comes to the below function9cnvcpltcallback) so i have added lines related to sd card. right now, i would like to konw how can i continously store the values of adc pin in sd card.
Please let me know.
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(hadc);
unsigned int temp=0;
adcval= HAL_ADC_GetValue(&hadc1);
/* NOTE : This function Should not be modified, when the callback is needed,
the HAL_ADC_ConvCpltCallback could be implemented in the user file
*/
temp = adcval;
f_open(&myFILE, "Write1.TXT\0", FA_WRITE | FA_CREATE_ALWAYS);
f_printf(&myFILE, "%d\r\n",temp);
f_close(&myFILE);
}
-
Thanks,
Ashok
