pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

PIN

案例程序

设置引脚输出高电平1秒,输出低电平1秒

from m5stack import *
from m5stack_ui import *
from uiflow import *
import machine
import time

while True:
  pin0.on()
  wait(1)
  pin0.off()
  wait(1)
  wait_ms(2)

功能说明

machine.Pin(0, mode=machine.Pin.IN, pull=machine.Pin.PULL_UP)
  • 设置引脚的方向
pin0.on()
  • 设置引脚为输出高电平
pin0.off()
  • 设置引脚为输出低电平
pin0.value(0)
  • 设置引脚的值
    • "0":低电平
    • "1":高电平
str(pin0.value())
  • 获取引脚读取的值
On This Page