I want to convert ADC Values to float numbers. This is my code:
uint32_t ADCValue;
char str[15];
ADCValue = HAL_ADC_GetValue(&hadc1);
ADCValue=ADCValue*3.3/4095;
sprintf(str, "%d", Voltage);
HAL_UART_Transmit(&huart2, (uint8_t*)(&str), 6, 100);
HAL_UART_Transmit(&huart2, (uint8_t*) "\n\r", 2, 100);
HAL_Delay(500);
I am reading value of 4095 at 3.3V but I am transmitting 3 to buffer. I want to transmit exact value of voltage.