pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Unit RFID

Example

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
On This Page