led_strip: use component manager in the example

This commit is contained in:
morris
2022-08-11 14:54:50 +08:00
parent 2761ad4865
commit dfafa619c7
15 changed files with 16 additions and 515 deletions

View File

@@ -49,7 +49,10 @@ static void configure_led(void)
.strip_gpio_num = BLINK_GPIO,
.max_leds = 1, // at least one LED on board
};
ESP_ERROR_CHECK(led_strip_new_rmt_device(&strip_config, &led_strip));
led_strip_rmt_config_t rmt_config = {
.resolution_hz = 10 * 1000 * 1000, // 10MHz
};
ESP_ERROR_CHECK(led_strip_new_rmt_device(&strip_config, &rmt_config, &led_strip));
/* Set all LED off to clear all pixels */
led_strip_clear(led_strip);
}