2020-12-25 04:08 AM
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();
}
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
Solved! Go to Solution.
2021-01-03 11:11 AM
DISCO-F746NG | Mbed read image with pinout description
2021-01-05 05:14 AM
Finally
2021-01-05 06:35 AM
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);