You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
536 B
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# I2C_AHT20
- 将PB6、PB7分别配置为I2C_SCL、I2C_SDA
- 在Project Manager - Code Generator中勾选Generate peripheral initialization as a pair of...
- 配置I2C1
- I2C选择I2C
- 配置USART2为Asynchronous
- 复制dht20.c/dht20.h文件到Core的Src/Inc目录下
- API
- DHT20_Init() 初始化AHT20
- DHT20_Get_T_H 获取温湿度
- 注意默认无法使用sprintf打印浮点数需要在工程Properties - C/C++ Build - Settings - MCU Settings中勾选Use float with printf from newlib -nano