Skip to main content
FLine.1
Associate II
December 25, 2020
Solved

Control Pins and communicate via usart issue

  • December 25, 2020
  • 22 replies
  • 4343 views

Helleo,

I am newbie in Touchgfx and I try developing first project.

I am willing to data transfer stm32746 to pc via usart and control pins.

When I click the button stm doesnt send data via usart or stm doesnt control pins.

Screen1View.cpp codes:

#include <gui/screen1_screen/Screen1View.hpp>
#include "stm32f7xx_hal.h"
extern UART_HandleTypeDef huart2;
 
Screen1View::Screen1View()
{
 
}
 
void Screen1View::setupScreen()
{
 Screen1ViewBase::setupScreen();
}
 
void Screen1View::tearDownScreen()
{
 Screen1ViewBase::tearDownScreen();
}
 
void Screen1View::led_on()
{
 
/*	HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_SET);
	HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_2|GPIO_PIN_5
	 |GPIO_PIN_3, GPIO_PIN_SET);
*/
	//HAL_GPIO_TogglePin(GPIOD, GPIO_PIN_5);
	//HAL_GPIO_TogglePin(GPIOD, GPIO_PIN_6);
 // textArea1.setVisible(true);
	char com_cevap[12] ="adc_veri\r\n ";
	HAL_UART_Transmit(&huart2, (uint8_t *) &com_cevap, 12, 200);
 btndurum.setAlpha(254);
 btndurum.invalidate();
 
}
 
void Screen1View::led_off()
{
/*	HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_2|GPIO_PIN_5
	 |GPIO_PIN_3, GPIO_PIN_RESET);
*/
	//HAL_GPIO_WritePin(GPIOD, GPIO_PIN_5, GPIO_PIN_RESET);
	//HAL_GPIO_WritePin(GPIOD, GPIO_PIN_6, GPIO_PIN_RESET);
 btndurum.setAlpha(50);
 btndurum.invalidate();
 
}

0693W000006GtqXQAS.png 

please tell me whats wrong? Could i control pins or data transfer in button click?

I use STMCubeIDe 1.5.1, Visual Studio 2019 and last framework.TouchGfx 4.15

This topic has been closed for replies.
Best answer by MM..1

DISCO-F746NG | Mbed read image with pinout description

22 replies

FLine.1
FLine.1Author
Associate II
January 3, 2021

Arduino:

0693W000006HLSTQA4.jpgSTM:

0693W000006HLSYQA4.jpg

MM..1
Super User
January 3, 2021

Maybe i dont understand your photo, but where you have touchGFX display and where you click ?

FLine.1
FLine.1Author
Associate II
January 3, 2021

I click Basla Button.0693W000006HLUPQA4.jpg

MM..1
MM..1Best answer
Super User
January 3, 2021

DISCO-F746NG | Mbed read image with pinout description

FLine.1
FLine.1Author
Associate II
January 5, 2021

Finally

0693W000006HYpGQAW.png

MM..1
Super User
January 5, 2021

Yes this is because

HAL_UART_Transmit(&huart2, (uint8_t *)giden,10,30);

when you not need send binary zero then change line to

HAL_UART_Transmit(&huart2, (uint8_t *)giden,strlen(giden),30);