English
English
简体中文
日本語

UiFlow Tutorial

UiFlow1 Development Guide

Project Management

Use LTE network

UiFlow1 Blockly

Event

Unit

Unit Buzzer

Example

The program triggers the buzzer to sound

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)

API

buzzer_0.set_freq(4000)
  • Set frequency
buzzer_0.set_buzzer(1)
  • Set Unit BUZZER status
Page Tools
PDF
On This Page