# MyLed组件 - 一个控制LED的组件 ``` #include "esp_log.h" #include "my_led.h" #define TAG "MAIN" extern "C" void app_main(void) { MyLed led12(GPIO_NUM_12); MyLed led13(GPIO_NUM_13); led12.StartContinuousBlink(); led13.EnableBrightnessAdjust(true, LEDC_CHANNEL_1, LEDC_TIMER_1); // led13.StartContinuousBlink(500); led13.SetBrightness(7); while(1) { vTaskDelay(pdMS_TO_TICKS(10*1000)); led13.SetBrightness(0); led12.TurnOn(); } } ```
idf.py add-dependency "smallin/my_led^1.0.0"