pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

PIN

Example

Set the pin to output a high level for 1 second and a low level for 1 second

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)

API

machine.Pin(0, mode=machine.Pin.IN, pull=machine.Pin.PULL_UP)
  • Set the direction of the pin.
pin0.on()
  • Set the pin to output high level.
pin0.off()
  • Set the pin to output low level.
pin0.value(0)
  • Set the value of the pin.
    • "0": Low level
    • "1": High level
str(pin0.value())
  • Get the value read from the pin.
On This Page