用了blink案例,光有打印,没有灯闪
Posted: Mon May 24, 2021 5:02 pm
用的是esp/esp-idf/examples/get-started/blink的案例,烧录进ESP32-C3-DevKitM-1的开发板中。
打开监视器看,只有"Turning off the LED"/ "Turning on the LED"的交替打印,但是灯没有闪。
编译指令如下:
475 get_idf
476 idf.py set-target esp32c3
477 idf.py menuconfig
(Top) → Component config → ESP32C3-Specific → Minimum Supported ESP32-C3 Revision--->Rev 2
478 idf.py build
479 idf.py -p /dev/ttyUSB0 flash
打开监视器看,只有"Turning off the LED"/ "Turning on the LED"的交替打印,但是灯没有闪。
- #define BLINK_GPIO CONFIG_BLINK_GPIO
- void app_main(void)
- {
- /* Configure the IOMUX register for pad BLINK_GPIO (some pads are
- muxed to GPIO on reset already, but some default to other
- functions and need to be switched to GPIO. Consult the
- Technical Reference for a list of pads and their default
- functions.)
- */
- gpio_reset_pin(BLINK_GPIO);
- /* Set the GPIO as a push/pull output */
- gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);
- while(1) {
- /* Blink off (output low) */
- printf("Turning off the LED\n");
- gpio_set_level(BLINK_GPIO, 0);
- vTaskDelay(1000 / portTICK_PERIOD_MS);
- /* Blink on (output high) */
- printf("Turning on the LED\n");
- gpio_set_level(BLINK_GPIO, 1);
- vTaskDelay(1000 / portTICK_PERIOD_MS);
- }
- }
475 get_idf
476 idf.py set-target esp32c3
477 idf.py menuconfig
(Top) → Component config → ESP32C3-Specific → Minimum Supported ESP32-C3 Revision--->Rev 2
478 idf.py build
479 idf.py -p /dev/ttyUSB0 flash