std-training icon indicating copy to clipboard operation
std-training copied to clipboard

The LED doesn't light up

Open mqxqls opened this issue 2 years ago • 1 comments

The LED doesn't light up

mqxqls avatar May 04 '22 03:05 mqxqls

I find that the gpio of led changed from gpio_8 to gpio_7.

zrz4066 avatar Jun 18 '22 00:06 zrz4066

If we're talking about the LED on the GPIO7 pin (ESP32-C3-DevKit-RUST-1 board), you can try:

const LED_PIN: i32 = 7;
unsafe {
    gpio_reset_pin(LED_PIN);
    assert_eq!(gpio_set_direction(LED_PIN, gpio_mode_t_GPIO_MODE_OUTPUT), ESP_OK);
    assert_eq!(gpio_set_level(LED_PIN, 1), ESP_OK);
}

gcoguiec avatar Oct 05 '22 13:10 gcoguiec