修正但仍有误

This commit is contained in:
2025-01-23 21:00:56 +08:00
parent d6009a0773
commit 7279c647ed
110 changed files with 809 additions and 31062 deletions

View File

@@ -45,19 +45,16 @@ const uint8_t tile[] = {2, 7};
// 常见颜色定义
const RGBColor_TypeDef LED_DARK = {0, 0, 0};
const RGBColor_TypeDef LED_GREEN = {255, 0, 0};
const RGBColor_TypeDef LED_RED = {0, 255, 0};
const RGBColor_TypeDef LED_BLUE = {0, 0, 255};
const RGBColor_TypeDef LED_WHITE = {255, 255, 255};
const RGBColor_TypeDef DARK = {0, 0, 0};
const RGBColor_TypeDef GREEN = {255, 0, 0};
const RGBColor_TypeDef RED = {0, 255, 0};
const RGBColor_TypeDef BLUE = {0, 0, 255};
const RGBColor_TypeDef WHITE = {255, 255, 255};
const RGBColor_TypeDef LT_RED = {0, 32, 0};
const RGBColor_TypeDef LT_GREEN = {32, 0, 0};
const RGBColor_TypeDef LT_BLUE = {0, 0, 32};
const RGBColor_TypeDef LT_WHITE = {16, 16, 16};
// 灯颜色缓存
RGBColor_TypeDef RGB_Data[LED_NUM] = {0};
@@ -250,16 +247,16 @@ void led_matrix_fill_test(uint8_t index)
void led_matrix_test1()
{
rt_memset(RGB_Data, 0x00, sizeof(RGB_Data));
Set_LEDColor(0, LED_RED);
Set_LEDColor(1, LED_GREEN);
Set_LEDColor(2, LED_BLUE);
Set_LEDColor(3, LED_RED);
Set_LEDColor(4, LED_GREEN);
Set_LEDColor(5, LED_BLUE);
Set_LEDColor(6, LED_RED);
Set_LEDColor(7, LED_GREEN);
Set_LEDColor(8, LED_BLUE);
Set_LEDColor(9, LED_WHITE);
Set_LEDColor(0, RED);
Set_LEDColor(1, GREEN);
Set_LEDColor(2, BLUE);
Set_LEDColor(3, RED);
Set_LEDColor(4, GREEN);
Set_LEDColor(5, BLUE);
Set_LEDColor(6, RED);
Set_LEDColor(7, GREEN);
Set_LEDColor(8, BLUE);
Set_LEDColor(9, WHITE);
// led_matrix_rst();
RGB_Reflash();
}
@@ -268,22 +265,22 @@ MSH_CMD_EXPORT(led_matrix_test1, Test led matrix on board)
void led_matrix_test2()
{
rt_memset(RGB_Data, 0x00, sizeof(RGB_Data));
Set_LEDColor(0, LED_BLUE);
Set_LEDColor(1, LED_RED);
Set_LEDColor(2, LED_GREEN);
Set_LEDColor(3, LED_BLUE);
Set_LEDColor(4, LED_RED);
Set_LEDColor(5, LED_GREEN);
Set_LEDColor(6, LED_BLUE);
Set_LEDColor(7, LED_RED);
Set_LEDColor(8, LED_GREEN);
Set_LEDColor(9, LED_RED);
Set_LEDColor(0, BLUE);
Set_LEDColor(1, RED);
Set_LEDColor(2, GREEN);
Set_LEDColor(3, BLUE);
Set_LEDColor(4, RED);
Set_LEDColor(5, GREEN);
Set_LEDColor(6, BLUE);
Set_LEDColor(7, RED);
Set_LEDColor(8, GREEN);
Set_LEDColor(9, RED);
Set_LEDColor(14, LED_GREEN);
Set_LEDColor(15, LED_GREEN);
Set_LEDColor(16, LED_BLUE);
Set_LEDColor(17, LED_RED);
Set_LEDColor(18, LED_WHITE);
Set_LEDColor(14, GREEN);
Set_LEDColor(15, GREEN);
Set_LEDColor(16, BLUE);
Set_LEDColor(17, RED);
Set_LEDColor(18, WHITE);
RGB_Reflash();
}

View File

@@ -9,19 +9,13 @@ typedef struct RGBColor_TypeDef
uint8_t B;
} RGBColor_TypeDef; // 颜色结构体
// extern const RGBColor_TypeDef DARK;
// extern const RGBColor_TypeDef GREEN;
// extern const RGBColor_TypeDef RED;
// extern const RGBColor_TypeDef BLUE;
// extern const RGBColor_TypeDef WHITE;
// //灯处于特定颜色还是闪烁状态
// extern uint8_t LED_Blink_Staue[LED_NUM]={0};
// // 灯闪烁颜色缓存
// extern RGBColor_TypeDef LED_Blink_Color[LED_NUM] = {0};
extern const RGBColor_TypeDef LED_DARK;
extern const RGBColor_TypeDef LED_GREEN;
extern const RGBColor_TypeDef LED_RED;
extern const RGBColor_TypeDef LED_BLUE;
extern const RGBColor_TypeDef LED_WHITE;
extern void Set_LEDColor(uint16_t LedId, RGBColor_TypeDef Color);
extern void RGB_Reflash(void);
extern void led_matrix_rst();
#endif