pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

2Relay

案例程序

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

setScreenColor(0x222222)
relay2_0 = unit.get(unit.RELAY2, unit.PORTA)

while True:
  relay2_0.set_value(3, 1)
  wait(1)
  relay2_0.set_value(3, 0)
  wait(1)
  wait_ms(2)

功能说明

relay2_0.set_value(ch, status)
  • 继电器控制:
    • ch:
      • 1:控制继电器1
      • 2:控制继电器2
      • 3:控制所有继电
    • status:
      • 1:on
      • 0:off
On This Page