cancel
Showing results for 
Search instead for 
Did you mean: 

Hi Everyone, I'm total rooki, I just start in stm32 an TouchGFX when I push my "buttonWithIcon1" I need reset on my pin PD6 and otherwise see myscreen2View.cpp for example:

LKlen.1
Associate

void Screen2View::up1()

{

   if (buttonWithIcon1.getPressedState()==true) HAL_GPIO_WritePin(GPIOD, GPIO_PIN_6,GPIO_PIN_RESET);

   else HAL_GPIO_WritePin(GPIOD, GPIO_PIN_6,GPIO_PIN_SET);

}

what is wrong, thans for help

4 REPLIES 4
Romain DIELEMAN
ST Employee

Hi,

Could you give a bit more information on how you set this up and what is the error you are facing ? have you properly defined those pins, included the hal, what is the "up1" function, when is it called, etc

This video from Gustavo might be of help as well. It explains how to communicate between the hardware and TouchGFX, in this case a LED is toggled for example when a button is pressed.

/Romain

Piranha
Chief II

Beginners should start with beginner topics, not a huge and complex projects...

LKlen.1
Associate

hi,

Function "up1" is named lifting up the blinds.

in my code is no errors but it not works. I just want to change value from high to low on my pin PD6 when I pushing the "buttonWithIcon1" and I dont know how correctly use "IF" in this case?

/Lucas

Are you sure your up1 function is actually called first ? Could you add a printf and see if you go inside this function and if it reacts as you want when the button is pressed ?

/Romain