forked from PAWPAW/lib_rgb
解耦test,example,重构effect为C(解决 #4 #6)
This commit is contained in:
22
examples/app_test_HSV_to_RGB/src/main.xc
Normal file
22
examples/app_test_HSV_to_RGB/src/main.xc
Normal file
@@ -0,0 +1,22 @@
|
||||
/** @brief 测试 HSV_to_RGB,以及饱和处理
|
||||
* @author Vergil Wong
|
||||
* @date 2023-11-25
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
|
||||
#include <platform.h> // 包含对封装的定义,引用以使用 on tile[] 语法
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void test_hsv_to_rgb();
|
||||
}
|
||||
|
||||
int main() // 定义主函数
|
||||
{
|
||||
par
|
||||
{
|
||||
on tile[1]: test_hsv_to_rgb();
|
||||
}
|
||||
return 0; // 返回0,表示程序正常结束
|
||||
}
|
||||
16
examples/app_test_HSV_to_RGB/src/test_hsv_to_rgb.c
Normal file
16
examples/app_test_HSV_to_RGB/src/test_hsv_to_rgb.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <stdint.h>
|
||||
#include "rgb_effect.h"
|
||||
void test_hsv_to_rgb()
|
||||
{
|
||||
uint32_t hue, sat, value; // HSV值
|
||||
uint32_t color; // RGB值
|
||||
|
||||
// 测试转换
|
||||
hue = 999;
|
||||
sat = 999;
|
||||
value = 999;
|
||||
|
||||
color = HSV_to_RGB(&hue, &sat, &value);
|
||||
|
||||
printf("GRB color is: 0x%06X\n", color);
|
||||
}
|
||||
Reference in New Issue
Block a user