I am trying to read data from analog pH and EC sensors to as ESP32 (Wroom-32D), using the library ADC. But it seems I can’t enable the ADC, as mgos_adc_enable(pin)
is returning false. I am calling the enable function at the beginning of my mgos_app_init. (Am doing it twice, since I have two sensors on two pins.)
I then call mgos_adc_read_voltage(pin)
in a timer (which understandably gives me values of 0).
Should I use mgos_gpio_set_mode(SensorPin_pH, MGOS_GPIO_MODE_INPUT);
as well as mgos_adc_enable
? I have tried both with and without, without success.