🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    X ERROR - unsupported types for __and__: 'function', 'int'

    Scheduled Pinned Locked Moved Micropython
    1 Posts 1 Posters 2.9k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      cwseabolt
      last edited by

      I keep receiving "X ERROR - unsupported types for _ and _: 'function', 'int' " on my M5Fire for the following code. Sometimes it happens right away, other times it works flawlessly for a little while and then I get the error. Can anyone help with this?

      0_1587593001795_uiflow1.PNG
      from m5stack import *
      from m5ui import *
      from uiflow import *
      import unit

      setScreenColor(0x222222)
      relay0 = unit.get(unit.RELAY, unit.PORTB)
      rfid2 = unit.get(unit.RFID, unit.PORTA)

      label1 = M5TextBox(253, 42, "ID:", lcd.FONT_DejaVu24,0xFFFFFF, rotate=90)
      label2 = M5TextBox(297, 42, "-", lcd.FONT_DejaVu24,0xFFFFFF, rotate=90)
      title = M5Title(title="Workshop", x=7 , fgcolor=0x000000, bgcolor=0xfefefe)
      label4 = M5TextBox(253, 83, "-", lcd.FONT_DejaVu24,0xFFFFFF, rotate=90)

      while True:
      relay0.off()
      label4.setText(str(rfid2.readUid()))
      label2.setColor(0xcccccc)
      label2.setText('Place ID Card')
      while rfid2.isCardOn():
      label4.setText(str(rfid2.readUid()))
      if (rfid2.readUid()) == '8848f1f1c':
      label2.setColor(0x33ff33)
      label2.setText('Proceed')
      relay0.on()
      else:
      label2.setColor(0xff0000)
      label2.setText('Access Denied!')
      break
      wait_ms(2)

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post