当前位置:网站首页>蓝桥杯嵌入式-HAL库-USART_TX
蓝桥杯嵌入式-HAL库-USART_TX
2022-07-28 10:25:00 【[email protected]】
硬件设计
所用引脚
PA10 ---------- USART1_RX 串口一接收引脚 用于接收数据
PA9 ---------- USART1_TX 串口一发送引脚 用于发送数据
PA8 ---------- USART1_CK “串口一同步引脚” 存在同步发送数据的功能(该引脚需要同步收发数据时使用,串口一般使用异步收发数据,不用同步收发数据)

知识点
1、sprintf函数的用法
例子:
int counter = 0;
char str[40];
sprintf(str, “%04d:Hello,world.\r\n”, counter);
实验结果如下:
sprintf 知识点链接:sprintf
2、HAL_USART_Transmit用法
HAL_USART_Transmit(&husart1,(unsigned char *)str, strlen(str), 50);
参数1:指针 串口1
参数2:要发送的字符数组
参数3:字符数组中内容的长度
参数4:超时时间 ms
函数说明如下:
串口调试助手—AccessPort
版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_44250317/article/details/114368044
边栏推荐
- GKSphereObstacle
- 机器人技术(RoboCup 2D)如何进行一场球赛
- GKCoherentNoiseSource
- Why does the cluster need root permission
- Database security - create login user + configure permissions [notes]
- AP AUTOSAR platform design 1-2 introduction, technical scope and method
- 机器学习--手写英文字母1--分类流程
- 8. Detailed explanation of yarn system architecture and principle
- SDUT Round 9 2020 Spring Festival campaign
- Uni app project directory, file function introduction and development specification
猜你喜欢

ACM寒假集训#5

11_ue4进阶_男性角色换成女性角色,并修改动画

机器学习--手写英文字母2--导入与处理数据

GKNoiseMap

Yarn报错:Exception message: /bin/bash: line 0: fg: no job control

5、Window端实现Mapreduce程序完成wordcount功能

逆元&组合数&快速幂

Two years of crud, two graduates, two months of preparation for the interview with ALI, and fortunately won the offer grading p6

SQL Server 2016 learning record - nested query
c语言进阶篇:指针(一)
随机推荐
PyQt5快速开发与实战 4.12 日历与时间
Markdown to word or PDF
Qt生成.exe文件 并 在无Qt环境下运行(Enigma Virtual Box进行绿色可执行软件封装)图文教程
Database security - create login user + configure permissions [notes]
20200229训练赛 L1 - 2 删除字符串中的子串 (20分)
蓝桥杯嵌入式-HAL库-LCD
AP Autosar平台设计 3架构
两年CRUD,二本毕业,备战两个月面试阿里,侥幸拿下offer定级P6
An example of SQL trace in MySQL
Operation log of dbeaver
Go json. Decoder Considered Harmful
11_ue4进阶_男性角色换成女性角色,并修改动画
6、MapReduce自定义分区实现
第11届蓝桥杯本科组校赛(20200321)
GKCircleObstacle
GKPolygonObstacle
287. Find the Duplicate Number
SQL Server 2016 learning records - set query
GKRandom
GKSpheresNoiseSource