We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0291969 commit c8cbe78Copy full SHA for c8cbe78
example/adc.py
@@ -19,7 +19,7 @@
19
last_duty = -1
20
while True:
21
# Read ADC voltage value
22
- voltage = adc.read_uv() / 1000000
+ voltage = adc.read_u16() / 10000
23
24
# Ensure voltage is within valid range
25
if voltage < MIN_VOLTAGE:
example/battery.py
@@ -12,7 +12,7 @@
12
adc = XiaoADC(adc)
13
14
# Read the battery voltage in microvolts and convert to volts
15
- vbat = adc.read_uv() / 1000000
+ vbat = adc.read_u16() / 10000
16
print("Battery Voltage: {:.4f} V".format(vbat))
17
time.sleep(0.1)
18
except KeyboardInterrupt:
0 commit comments