【STM32F1】驱动DHT11(CubeMX配置)(HAL库)
DHT11时序逻辑:CubeMX配置:DHT11.c程序:#include "stm32f1xx.h"#include "tim.h"#include "dht11.h"uint8_t Data[5]={0x00,0x00,0x00,0x00,0x00}; //Data存储读取的温湿度信息 void Delay_us(uint16_t us){ //微秒延时 uint16_t differ = 0xffff-us-5;