From c787ae69039b6141a7e3f78b319c8c42d89509d5 Mon Sep 17 00:00:00 2001 From: xuhongv Date: Tue, 31 Mar 2020 14:08:12 +0800 Subject: [PATCH] 2020-3-31 add examples for HSV 2020-3-31 add examples for HSV --- 17_light_utils_pwm/main/light_example.c | 26 +++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/17_light_utils_pwm/main/light_example.c b/17_light_utils_pwm/main/light_example.c index 824c054..f7ec1ed 100644 --- a/17_light_utils_pwm/main/light_example.c +++ b/17_light_utils_pwm/main/light_example.c @@ -17,6 +17,29 @@ #include "nvs_flash.h" #include "esp_log.h" +/** + * @description: HSV模型设置: 参考 http://www.yuangongju.com/color + * @param {type} + * @return: + */ +static void Task_set_hsv(void *parm) +{ + while (1) + { + light_driver_set_hsv(0, 100, 100); /**< red */ + vTaskDelay(2000 / portTICK_PERIOD_MS); + light_driver_set_hsv(240, 100, 100); /**< blue */ + vTaskDelay(2000 / portTICK_PERIOD_MS); + light_driver_set_hsv(120, 100, 100); /**< green */ + vTaskDelay(2000 / portTICK_PERIOD_MS); + light_driver_set_hsv(270, 98, 99); /**< color #8306fc */ + vTaskDelay(2000 / portTICK_PERIOD_MS); + light_driver_set_hsv(60, 100, 100); /**