Page 317 - MDP2020-1
P. 317
················································································ 명장양성프로젝트 【MDP】 과제발표회 자료집 Ⅰ | 311
/* USER CODE BEGIN PV */
/* USER CODE END PV */
/* Private function prototypes
-----------------------------------------------*/
void SystemClock_Config(void);
/* USER CODE BEGIN PFP */
uint8_t bf[50];
uint32_t ADC_read[3] ={0};
uint8_t receive_data[10] = {'x'};
uint8_t dht_data[10];
uint16_t humi=0,temp =0;
control_handle control;
/* USER CODE END PFP */
/* Private user code
---------------------------------------------------------*/
/* USER CODE BEGIN 0 */
void Delay_microsec(volatile uint32_t microsec)
{
microsec *= (22);
while(microsec--);
}
uint8_t DHT11_Read(uint8_t *data)
{
uint8_t i,b_state = 0;
uint16_t cnt=0,delay;
HAL_GPIO_WritePin(DHT11_GPIO_Port, DHT11_Pin, GPIO_PIN_SET);
Delay_microsec(10);
if(HAL_GPIO_ReadPin(DHT11_GPIO_Port,DHT11_Pin) == 0){
return 0;
}
HAL_GPIO_WritePin(DHT11_GPIO_Port, DHT11_Pin, GPIO_PIN_RESET);
HAL_Delay(19);