English
English
简体中文
日本語

UiFlow Tutorial

UiFlow1 Development Guide

Project Management

Use LTE network

UiFlow1 Blockly

Event

Unit

Unit RFID

Example

Detects the nearest IDCard and returns data

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

setScreenColor(0x222222)
rfid_0 = unit.get(unit.RFID, unit.PORTA)

while True:
  print(rfid_0.isCardOn())
  if rfid_0.isCardOn():
    print(rfid_0.readUid())
  wait_ms(2)

API

print(rfid_0.isCardOn())
  • RFID card near return 1
print(rfid_0.readBlockStr(1))
  • Read data from an address
print(rfid_0.readUid())
  • Returns the UID of the RFID card
rfid_0.writeBlock(1,'M5Stack')
  • Writes data to an address
Page Tools
PDF
On This Page