修改亮灯逻辑
This commit is contained in:
@@ -8,6 +8,7 @@ rmt_transmit_config_t tx_config = {
|
||||
|
||||
static uint8_t led_strip_pixels[EXAMPLE_LED_NUMBERS * 3];
|
||||
uint16_t toggle_cycle = 1000;
|
||||
bool toggle_flag = true;
|
||||
static uint8_t rgb_color_index = RGB_COLOR_RAD;
|
||||
|
||||
rgb_color_t rgb_color_rad = {0,255,0,0,0,1,0};
|
||||
@@ -113,6 +114,8 @@ void _work_rgb_led(void *arg)
|
||||
|
||||
void rgb_update_cyle(uint16_t cyle)
|
||||
{
|
||||
toggle_flag = (cyle == 888 ? false : true);
|
||||
|
||||
toggle_cycle = cyle;
|
||||
}
|
||||
uint8_t breathing_dispose(rgb_color_t* rgb_color,int16_t* vel, uint8_t color_min, uint8_t color_max)
|
||||
@@ -194,8 +197,9 @@ void rgb_toggle(rgb_color_t* rgb_color)
|
||||
led_strip_set_pixel(0,rgb_color->index,rgb_color->green,rgb_color->blue,rgb_color->red);
|
||||
else
|
||||
led_strip_set_pixel(0,rgb_color->index,0,0,0);
|
||||
|
||||
rgb_color->toggle_flag = !rgb_color->toggle_flag;
|
||||
|
||||
if(toggle_flag == true)
|
||||
rgb_color->toggle_flag = !rgb_color->toggle_flag;
|
||||
}
|
||||
|
||||
void rgb_color_change(uint8_t index, uint8_t color)
|
||||
|
||||
Reference in New Issue
Block a user