2020-09-08 06:22 PM
Dear all
Displaying analog voltage value on TouchGFX GUI using STM32F746G-DISCO kit.
I watched YouTube and followed it.
The ADC input is up to 3.3V, but the value displayed on the LCD is displayed in a very large number. The ADC is 12 bits and the output is 3.3/4096. If it is normal, the maximum voltage should be displayed as 3.3V on the LCD screen, but I can't figure out why such a large value is displayed.
Please let me know what's wrong.
void Screen1View::analogUpdate(uint32_t value)
{
memset(&textAreaADBuffer, 0, TEXTAREAAD_SIZE);
Unicode::snprintfFloat(textAreaADBuffer, sizeof(textAreaADBuffer), "%.3f", value * 0.000805664 ); // 3.3/4096 = 0.000805664
textAreaAD.invalidate();
}
2020-09-08 10:43 PM
Try : (float) value * 3.3f / 4096.0f