pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Unit Buzzer

案例程序

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

setScreenColor(0x222222)
buzzer_0 = unit.get(unit.BUZZER, unit.PORTB)

buzzer_0.set_buzzer(1)
while True:
  buzzer_0.set_freq(4000)
  wait_ms(2)

功能说明

buzzer_0.set_freq(4000)
  • 设置频率
buzzer_0.set_buzzer(1)
  • 设置Unit BUZZER 状态
On This Page