pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Unit DAC

Example

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