s far as I can tell it may be that the input doesn't need to be connected at all for ADC to work
I see, in that case I will try to change line jshPinSetState(pin, JSHPINSTATE_ADC_IN); to jshPinSetState(pin, JSHPINSTATE_UNDEFINED ) tonight and see what happens with reported battery voltage.
EDIT:
or I better move the case JSHPINSTATE_ADC_IN: few lines up to be the same as case JSHPINSTATE_UNDEFINED: instead of being same as case JSHPINSTATE_GPIO_IN:
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I see, in that case I will try to change line jshPinSetState(pin, JSHPINSTATE_ADC_IN); to jshPinSetState(pin, JSHPINSTATE_UNDEFINED ) tonight and see what happens with reported battery voltage.
EDIT:
or I better move the case JSHPINSTATE_ADC_IN: few lines up to be the same as case JSHPINSTATE_UNDEFINED: instead of being same as case JSHPINSTATE_GPIO_IN: