pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

2Relay

Example

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)

API

relay2_0.set_value(ch, status)
  • Relay control:
    • ch:
      • 1:control relay 1
      • 2:control relay 2
      • 3:control all relay
    • status:
      • 1:on
      • 0:off
On This Page