English
English
简体中文
日本語

UiFlow Tutorial

UiFlow1 Development Guide

Project Management

Use LTE network

UiFlow1 Blockly

Event

Unit

Unit DAC

Example

DAC (digital to analog Converter) unit to output different analog voltage values

from m5stack import *
from m5ui import *
from uiflow import *
import time
import unit

setScreenColor(0x222222)
dac_0 = unit.get(unit.DAC, unit.PORTA)

i = None

while True:
  for i in range(4):
    dac_0.setVoltage(i,save=True)
    print((str(str(i)) + str('V')))
    wait(1)
  wait_ms(2)

API

dac_0.setVoltage(1,save=True)
  • Set the voltage of the DAC
dac_0.writeData(1,save=True)
  • Set the DAC value
Page Tools
PDF
On This Page