#include "iot_boardled.h" #include "iot_boardbutton.h" #include "iot_sntp.h" #include "ohos_init.h" #include #include #include #include #include #include #include "red.h" #include #include "iot_gpio.h" void EntryMain(void) { float ad_value1; float ad_value2; BoardInit(); osDelay(100); printf("=================================================\r\n"); printf("************* human_detect_example ***********\r\n"); printf("=================================================\r\n"); for(;;) { float tempNTC; float tempTP; IoTGpioSetOutputVal (12,1); osDelay(50); ad_value1 = GetVoltage(); tempNTC = TEMP1(); printf("+++***@@@ ad_value is %fV\r\n",ad_value1); IoTGpioSetOutputVal (12,0); osDelay(50); ad_value2 = GetVoltage(); tempTP = HUMAN(); printf("+++***@@@ ad_value2 is %fV\r\n",ad_value2); printf("ntc temp = %f \n",tempNTC); printf("tp temp = %f \n",tempTP); if (tempTP > 38) { BeepStatusSet(ON); LedSafeStatusSet(OFF); LedWarnStatusSet(ON); }else{ BeepStatusSet(OFF); LedSafeStatusSet(ON); LedWarnStatusSet(OFF); } printf("human temp is %d\r\n",tempTP); osDelay(100); } } APP_FEATURE_INIT(EntryMain);