Boot button as GPIO
Posted: Mon Jan 29, 2024 6:16 pm
In this example, https://github.com/espressif/esp-idf/bl ... ain.c#L101 it seems GPIO0 is used as a button and when it is pressed, mqtt publishes something.
My problem is that it is not working on my official ESP-C6 devkit. I read somewhere that the boot button is connected to GPIO0, and I don't have to do anything special to use it as GPIO0.
My devkit information is here: https://docs.espressif.com/projects/esp ... guide.html
I tried to change to as schematics in this page suggests, but not hope.
My problem is that it is not working on my official ESP-C6 devkit. I read somewhere that the boot button is connected to GPIO0, and I don't have to do anything special to use it as GPIO0.
Code: Select all
#define EXAMPLE_BUTTON_GPIO 0
static void check_button(void* args)
{
static bool old_level = true;
bool new_level;
bool run_check_button = true;
initialise_button();
while (run_check_button) {
new_level = gpio_get_level(EXAMPLE_BUTTON_GPIO);
I tried to change
Code: Select all
#define EXAMPLE_BUTTON_GPIO 0
Code: Select all
#define EXAMPLE_BUTTON_GPIO 8