当前位置:网站首页>05 USART sending and receiving data (query mode)
05 USART sending and receiving data (query mode)
2022-07-18 02:33:00 【haichuangdianzi】
Modify on the basis of the first experiment .
First click on ① It's about , according to ②~⑥ Configure at ,⑦ You can keep still .
Modify after setting keil.
int main(void)
{
/* USER CODE BEGIN 1 */
char str[14] = "Hello World ";
char recv_buf[14] = {
0};
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USART1_UART_Init();
/* USER CODE BEGIN 2 */
HAL_UART_Transmit(&huart1, (uint8_t*)str, 12, 0xFFFF);
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
if(HAL_OK == HAL_UART_Receive(&huart1, (uint8_t*)recv_buf, 12, 0xFFFF))
{
HAL_UART_Transmit(&huart1, (uint8_t*)recv_buf, 12, 0xFFFF);
}
}
/* USER CODE END 3 */
}
边栏推荐
- Beijing Institute of technology - spring 2021 - Digital Logic Experiment
- 在 CDP中使用Iceberg 为数据湖仓增压
- 手机怎样控制led显示屏发视频?
- Fragment (III) using fragment in viewpager
- [NLP] deepke, an open source knowledge extraction tool that supports low resources, long chapters and multimodality
- [flag] build a website around Li Jian that sorts and classifies by time axis and content (zero basis) (continuous update)
- 抖音推出“团购配送”,探索外卖新模式
- three. JS infinite running VR games
- 41: Chapter 4: develop file services: 2:fastdfs: (2): prepare two virtual machines, and then create two fastdfs basic environments; Configure tracker service on a virtual machine; Configure storage se
- Niu Wenwen: specialized in the new era, new models and new styles are needed
猜你喜欢

2022-04-18 Unity入门1——窗口布局

07 printf重定向

Google recommends using kotlin flow in MVVM architecture

02 STM32CubeMX新建工程

互联网还有未来吗?

Involve yourself? After imagen, it launched an image model generated by 20billion text, which stunned netizens!

41: Chapter 4: develop file services: 2:fastdfs: (2): prepare two virtual machines, and then create two fastdfs basic environments; Configure tracker service on a virtual machine; Configure storage se

Latex數學公式

Beijing Institute of technology - spring 2021 - Digital Logic Experiment

2022-04-18 unity getting started 3 - script Basics
随机推荐
许式伟:Go+ 演进之路
Tiktok launched "group purchase and distribution" to explore a new model of takeout
Single vehicle management system - 1 Document design and SQL code description
The difference between the elements dependencies and dependencymanagement
抖音推出“团购配送”,探索外卖新模式
堆排序
MySQL的隔离级别
龙蜥社区招募推广大使&体验官啦!| 人人都可以参与开源
竟然如此简单,DataBinding 和 ViewBinding
STM32 and Internet of things 02 network data sending and receiving
Experiment 1 Security mechanism of SQL Server
Landing DDD (7) - some misunderstandings in tactical design
What are the main functions of Yunna dynamic ring monitoring system
2022-04-20 Unity入门9——其他
Native JS route realizes page Jump
Oracle 添加索引造成其他用户对此表的查询权限丢失
Summer learning plan [activities]
Configure the C locale of sublime
2022-04-21 unity entry 8 - sound system
MQTT---Connect