pdf-icon

UIFlow Guide

UiFlow1 Blockly

Event

Unit

UiFlow1 Project

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
On This Page
Example
API
Q&A
Submit a question
Select question category*
Arduino
MicroPython
UIFlow1
UIFlow2
EzData
M5Burner
Software
Hardware
Other
Product name
Product version
Question description*
(Supports pasting screenshots.)
Attachments
Add Files
Email*
Submit
OK

M5Stack Support

Hi, this is M5Stack Support. How can I help you today?