Page 1 of 1

Pullup and Pulldown Resistor GPIO ESP32

Posted: Sun Jan 03, 2021 10:24 am
by flowjmaria
Hello everyone, I'd to know how to use pull_up and pull_down internal resistor GPIO (ESP32) with "Code C" in flowcode v9. Can anyone help me?

Thanks.

Re: Pullup and Pulldown Resistor GPIO ESP32

Posted: Mon Jan 04, 2021 4:10 pm
by BenR
Hello,

You can try this, replacing 0 with the GPIO number you want to add the pull up or pull down to.

Pull Up

Code: Select all

gpio_set_pull_mode(0, GPIO_PULLUP_ONLY);
Pull Down

Code: Select all

gpio_set_pull_mode(0, GPIO_PULLDOWN_ONLY);
Pull Up and Down

Code: Select all

gpio_set_pull_mode(0, GPIO_PULLUP_PULLDOWN);
Turn off again

Code: Select all

gpio_set_pull_mode(0, GPIO_FLOATING);

Re: Pullup and Pulldown Resistor GPIO ESP32

Posted: Tue Jan 05, 2021 10:49 am
by flowjmaria
Hello BenR, it works properly.

Thanks a lot