1单片机数据读取代码:#include "DS18B20_1.h"#include "delay.h"#include "myfun.h"//修改管脚时,只需要修改下面几个#define DQ_PORT_NUM B#define DQ_PIN_NUM 11#define DQ_PIN _STR_JOIN2(GPIO_Pin_,DQ_PIN_NUM)#define DQ_PORT _STR_JOIN2(GPIO,DQ_PORT_NUM)#define DQ_RCC_PORT _STR_JOIN2(RCC_APB2Periph_GPIO,DQ_PORT_NUM)#define DQ_H() DQ_PORT->BSRR = DQ_PIN#define DQ_L() DQ_PORT->BRR = DQ_PIN#define DQ_READ() ((DQ_PORT->IDR & DQ_PIN) != 0)#define DQ_CRX _STR_JOIN2(CRX_, DQ_PIN_NUM)#define DQ_CRX_ZERO (_STR_J...
发表评论取消回复