pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

ADC

案例程序

串口打印获取的电压值和原始数值

from m5stack import *
from m5ui import *
from uiflow import *
import hat
import hat

setScreenColor(0x111111)

hat_adc_1 = hat.get(hat.ADC)

print(hat_adc_1.voltage)
print(hat_adc_1.rawData())

功能说明

hat_adc_0.rawData()
  • 读取ADC的原始值
hat_adc_0.voltage
  • 读取ADC的电压值
On This Page