2022-12-06 07:23 AM
i was planning to do an experiment i need to insert two numbers and calculate the sum of that two inserted number. Then i need to see them in terminal. However i have confused a bit. Could anyone help me? I get stuck over here.
/* USER CODE END 2 */
int First_Digit;
int Second_Digit;
int Sum_Digits;
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
uint8_t First_Digit[] = "first digit \r\n"; // data to send
HAL_UART_Transmit(&huart2, First_Digit, 18, 100);
HAL_Delay(2000);
uint8_t Second_Digit[] = "second digit \r\n"; // data to send
HAL_UART_Transmit(&huart2, Second_Digit, 18, 100);
HAL_Delay(2000);
uint8_t Sum_Digits[] = "sum \r\n"; // data to send
HAL_UART_Transmit(&huart2, Sum_Digits, 12, 100);
HAL_Delay(2000);
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
2022-12-09 07:31 PM
Both methods cover 2 compromizes:
Best for reactivity and small ram usage
Best for low latency and minimizing interrupt occurence rate.
Thoughts?
2022-12-12 02:12 AM
thnx for answer but how can i perform to sum of two number with that this is the big problem for me. could u help me about it?