pdf-icon

UIFlow Guide

UiFlow1 Blockly

Event

Unit

UiFlow1 Project

Unit Fan

Example

Start the motor

from m5stack import *
from m5stack_ui import *
from uiflow import *
import unit

screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)
fan_0 = unit.get(unit.FAN, unit.PORTB)

while True:
  fan_0.on(10)
  wait_ms(2)

API

fan_0.off()
  • Turn off the motor
fan_0.on(10)
  • Set the duty cycle of the motor
On This Page