Code: Select all
from machine import ADC, Pin
import time
BATTERY_CHARGE_STATUS = 34
BATTERY_READOUT_PIN = 35
adc1 = ADC(Pin(BATTERY_CHARGE_STATUS))
adc1.width(ADC.WIDTH_10BIT)
adc2 = ADC(Pin(BATTERY_READOUT_PIN))
adc2.width(ADC.WIDTH_12BIT)
while True:
value1 = adc1.read()
value2 = adc2.read()
print("Value1: {}, value2: {}".format(value1, value2))
time.sleep(2)
The last width declaration always decides the width of all adc's. Is this intended behaviour?
Micropython version: esp32-idf3-20191220-v1.12