UIFlow 上手教程
测量电压
from m5stack import *
from m5ui import *
from uiflow import *
import time
import unit
setScreenColor(0x222222)
VMeter_0 = unit.get(unit.VMETER, unit.PORTA)
while True:
print((str('Voltage: ') + str(((str((VMeter_0.voltage())) + str(' mV'))))))
wait(0.3)
wait_ms(2)
print((str('raw:') + str((VMeter_0.raw()))))
VMeter_0.setGain(VMeter_0.PGA_256)
VMeter_0.setMode(VMeter_0.MODE_CONTINUOUS)
VMeter_0.setRate(VMeter_0.RATE_8)
print((str('V:') + str((VMeter_0.voltage()))))