Incorrect GPIO readings
Posted: Fri Sep 20, 2019 12:33 am
Hey everyone,
I've been trying to work specifically with a few pins connected to my battery, specifically 32,36,39 and 35. I know that I can only set 34-39 as input only, but I am trying to set 32 as high and for whatever reason when using gpio_get_level I'm not getting back the correct value. I'm reading directly on the pin with a voltmeter and it's high but when I read with gpio_get_level it's returning 0. Any suggestions? Here is my code please check if I'm doing something incorrectly:
Cheers,
Gibson
I've been trying to work specifically with a few pins connected to my battery, specifically 32,36,39 and 35. I know that I can only set 34-39 as input only, but I am trying to set 32 as high and for whatever reason when using gpio_get_level I'm not getting back the correct value. I'm reading directly on the pin with a voltmeter and it's high but when I read with gpio_get_level it's returning 0. Any suggestions? Here is my code please check if I'm doing something incorrectly:
Code: Select all
gpio_pad_select_gpio(GPIO_NUM_32);
gpio_set_direction(GPIO_NUM_32, GPIO_MODE_OUTPUT);
gpio_set_level(GPIO_NUM_32, 1);
Gibson