| 123456789101112131415161718192021222324252627282930 |
- #include <stdio.h>
- #include "freertos/FreeRTOS.h"
- #include "freertos/task.h"
- #include "driver/gpio.h"
- #include "esp_log.h"
- #include "led_strip.h"
- #include "sdkconfig.h"
- #include "LED.h"
- static const char *TAG = "LED_Control";
- led_strip_handle_t led_strip = NULL;
- led_strip_handle_t configure_led(void)
- {
- led_strip_config_t strip_config = {
- .strip_gpio_num = 38,
- .max_leds = 1,
- };
- // LED strip backend configuration: RMT
- led_strip_rmt_config_t rmt_config = {
- .clk_src = RMT_CLK_SRC_DEFAULT,
- .resolution_hz = (10 * 1000 * 1000),
- };
- led_strip_handle_t handle = NULL;
- ESP_ERROR_CHECK(led_strip_new_rmt_device(&strip_config, &rmt_config, &handle));
- ESP_LOGI(TAG, "Created LED strip object with RMT backend");
- return handle;
- }
|