On the ESP8266 there is only a single-channel, which is multiplexed with the battery voltage. Depending on the setting in the "esp init data" (byte 107) one can either use the ADC to read an external voltage, or to read the system voltage (vdd33), but not both.
Which mode to use the ADC in can be configured via the `adc.force_init_mode()` function. Note that after switching from one to the other a system restart (e.g. power cycle, reset button, [`node.restart()`](node.md#noderestart)) is required before the change takes effect.
Checks and if necessary reconfigures the ADC mode setting in the ESP init data block.
####Syntax
`adc.force_init_mode(mode_value)`
####Parameters
`mode_value` One of `adc.INIT_ADC` or `adc.INIT_VDD33`.
####Returns
True if the function had to change the mode, false if the mode was already configured. On a true return the ESP needs to be restarted for the change to take effect.
####Example
```lua
-- in you init.lua:
if adc.force_init_mode(adc.INIT_VDD33)
then
node.restart()
return -- don't bother continuing, the restart is scheduled
If the ESP8266 has been configured to use the ADC for reading the system voltage, this function will always return 65535. This is a hardware and/or SDK limitation.
If the ESP8266 has been configured to use the ADC for sampling the external pin, this function will always return 65535. This is a hardware and/or SDK limitation.