pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

DAC2

输出读取的电压值

案例程序

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

setScreenColor(0x111111)

hat_dac2_0 = hat.get(hat.DAC2)

hat_dac2_0.setDACOutputVoltageRange(hat_dac2_0.RANGE_5V)

功能说明

hat_dac2_0.setDACOutputVoltageRange(hat_dac2_0.RANGE_5V)
  • 设置 DAC 输出电压范围,当前选择为 RANGE_5V
hat_dac2_0.setVoltage(5, channel=hat_dac2_0.CHANNEL_0)
  • 为 Channel 0 设置输出电压为 5V
hat_dac2_0.setVoltageBoth(5, 5)
  • 同时为 Channel 0 和 Channel 1 设置输出电压,均为 5V
On This Page