Files
lib_rgb/examples/app_hsv_cycle_example/src/main.xc

34 lines
975 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/** @brief RGB循环呼吸
*
* 驱动HSV颜色空间中的颜色循环以实现连续的颜色渐变效果。
*
* 此函数初始化颜色值并进入一个无限循环不断地计算新的颜色值并更新LED阵列。
* 使用并发执行关键字 'par' 来实现循环内部的并行处理。这个函数假定运行环境支持并行关键字 'par'。
*
* 在此循环中,它首先使用当前颜色填充一个预定义大小的缓冲区,然后调用 `cycleHSV` 函数
* 来更新当前色相值并获取新的颜色。最后它打印出当前的GRB颜色值。
* @author Vergil Wong
* @date 2023-11-25
* @param
* @return
*/
#include <platform.h> // 包含对封装的定义,引用以使用 on tile[] 语法
extern "C"
{
void hsv_cycle_example();
}
int main() // 定义主函数
{
par
{
on tile[1]:
{
hsv_cycle_example();
}
}
return 0; // 返回0表示程序正常结束
}