ESP32-S3 GPIO18 not changing levles

divraj
Posts: 4
Joined: Tue Dec 29, 2020 11:58 pm

ESP32-S3 GPIO18 not changing levles

Postby divraj » Wed Feb 01, 2023 8:30 pm

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;
}

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32-S3 GPIO18 not changing levles

Postby ESP_Sprite » Thu Feb 02, 2023 2:13 am

We generally suggest to use either gpio_config or do a gpio_reset before using a GPIO pin for something.

Who is online

Users browsing this forum: Baidu [Spider], MicroController and 105 guests