xTaskCreate();

The problem I have is that the program executes the task at dk_task. My intention is to use dk_task as task to compare condition.

if (adc_percent < 50)
           {
           cyhal_gpio_write( P10_6, true );
           }
           other
           {
           cyhal_gpio_write(P10_6, false);
           }
           if (notify_humidity < 60)
           {
               cyhal_gpio_write( P10_6, true );
           }
           other
           {
           cyhal_gpio_write(P10_6, false);
           }
           if (notice_temperature > 35)
           {
               cyhal_gpio_write( P10_6, true );
           }
           other
           {
               cyhal_gpio_write(P10_6, false);
           }
}

I set up pin P10_6 to control my motor. If the above condition is satisfied, the above code will control the motor to open, if not, the motor will be turned off.
But when executing the program dk_task opens the motor permanently and does nothing else!
I don’t understand what the problem I am having!
I have tried many methods as above but still can’t find the problem!
Thank!