Page 1 of 1

ESP32-S3 GPIO18 not changing levles

Posted: Wed Feb 01, 2023 8:30 pm
by divraj
Problem:
Trying to turn on and off GPIO18 (using as digital output) with a button. The code is running however the voltage level for GPIO18 is staying at 1.6v.

I have GPIO8 wired the same way and running the same code and that is working fine. Is there something internally attached to GPIO18 which could be stopping it from working as a normal GPIO.

Code running:

Code: Select all

esp_err_t initPump(void) {
    gpio_pad_select_gpio(GPIO_NUM_18);
    ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_18, GPIO_MODE_OUTPUT));
    gpio_set_level(GPIO_NUM_18, 0);
    return ESP_OK;
}

Re: ESP32-S3 GPIO18 not changing levles

Posted: Thu Feb 02, 2023 2:13 am
by ESP_Sprite
We generally suggest to use either gpio_config or do a gpio_reset before using a GPIO pin for something.