cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying analog voltage value on TouchGFX GUI using STM32F746G-DISCO kit. Display ADC value on LCD screen using TouchGFX.

Kss.1
Associate II

https://www.youtube.com/watch?v=EbWOv_0Lp-U&t=1873s

I saw this YouTube and tried to do the same.

The textArea1Buffer variable declaration error occurred in Screen1View.cpp, and the screen was declared in Screen1View.hpp to complete the compilation.

#include <gui/screen1_screen/Screen1View.hpp>

#include "string.h"

Screen1View::Screen1View()

{

}

void Screen1View::setupScreen()

{

  Screen1ViewBase::setupScreen();

}

void Screen1View::tearDownScreen()

{

  Screen1ViewBase::tearDownScreen();

}

void Screen1View::analogUpdate(uint32_t value)

{

memset(&textArea1Buffer, 0, TEXTVIEW_BUFF_SIZE);

Unicode::snprintfFloat(textArea1Buffer, sizeof(textArea1Buffer), "%.3f", value * 0.000805664 ); // // 3.3/4096 = 0.000805664//

textArea1.invalidate();

protected:

static const uint16_t TEXTVIEW_BUFF_SIZE = 50;

Unicode::UnicodeChar textArea1Buffer[TEXTVIEW_BUFF_SIZE];

Compile was completed normally in CubeIDE compilation environment.

However, since the ADC value is not updated, turning the potential meter on the LCD bottom does not change.

Why am I doing something wrong and why is the ADC value not updating?

I lost everything for two weeks on this issue. I think I will die. Who can help me?

I attach the main source I wrote.

Why it works on YouTube, but why not?

Please help me.

3 REPLIES 3
allard
Senior

Do you call Screen1View::analogUpdate(uint32_t value) in some kind of timer? Such as : Screen1View::handleTickEvent()

Dear allard​

Sorry, but please refer to the attached source.

I'm not sure exactly what question you are asking.

thank you

I also had a same question like where should we call the Screen1View::analogUpdate function?? in some sort of timer interrupt or can we call it in a main while loop?