当前位置:网站首页>蓝桥杯嵌入式-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
边栏推荐
- Excel word simple skills sorting (continuous update ~)
- Operation log of dbeaver
- GKConstantNoiseSource
- 蓝桥杯嵌入式-HAL库-USART_RX
- C language input string with spaces
- GKRandom
- Implement a queue with two stacks [C language]
- AP AUTOSAR platform design 3 architecture
- GKSphereObstacle
- SQL Server 2016 learning records - single table query
猜你喜欢

django-celery-redis异步发邮件

Qt生成.exe文件 并 在无Qt环境下运行(Enigma Virtual Box进行绿色可执行软件封装)图文教程

粒子群解决tsp的技术问题

GKConstantNoiseSource

SemEval 2022 | 将知识引入NER系统,阿里达摩院获最佳论文奖

ICML 2022 | 图表示学习的结构感知Transformer模型

Aike AI frontier promotion (7.28)

GKBillowNoiseSource

两年CRUD,二本毕业,备战两个月面试阿里,侥幸拿下offer定级P6

I don't know how lucky the boy who randomly typed logs is. There must be a lot of overtime
随机推荐
C语言 输入带空格的字符串
安装office自定义项 安装期间出错 解决办法
非关系型数据库MongoDB的特点及安装
2020 second intelligence cup preliminaries
GKNoise
GKRandomSource
GKCircleObstacle
机器学习--手写英文字母3--工程特点
Chapter 1: cross end development of small programs of uniapp ----- create a uniapp project
GKRandom
PyQt5快速开发与实战 4.13 菜单栏、工具栏与状态栏 and 4.14 QPrinter
GKNoiseSource
Redis-day01 common sense supplement and redis introduction
GKPerlinNoiseSource
20200229训练赛 L2 - 2 树种统计 (25分)
OCR knowledge summary
SDUT Round 9 2020 Spring Festival campaign
Install Office customization. Troubleshooting during installation
SDUT Round #9 2020-新春大作战
Can kingbasees v8r6 JDBC use VIP?