pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

DAC2

Outputs the read voltage value.

Example

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)

API

hat_dac2_0.setDACOutputVoltageRange(hat_dac2_0.RANGE_5V)
  • Sets the DAC output voltage range; currently set to RANGE_5V.
hat_dac2_0.setVoltage(5, channel=hat_dac2_0.CHANNEL_0)
  • Sets the output voltage for Channel 0 to 5V.
hat_dac2_0.setVoltageBoth(5, 5)
  • Sets the output voltage for both Channel 0 and Channel 1 to 5V each.
On This Page