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

    Trying to get stick V working

    UIFlow
    1
    1
    2.8k
    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.
    • J
      JhonnyTank
      last edited by

      I am trying to get the Stick V working.
      I flashed it with the firmware 1.2 of target trace.
      I am using this code wit UIFlow Beta:
      from m5stack import *
      from m5ui import *
      from uiflow import *
      import unit

      setScreenColor(0x222222)

      rectangle0 = M5Rect(134, 104, 30, 30, 0xFFFFFF, 0xFFFFFF)
      Follow = M5Title(title="Title", x=3 , fgcolor=0xFFFFFF, bgcolor=0x0000FF)
      label0 = M5TextBox(5, 30, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)
      label1 = M5TextBox(70, 30, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)

      x = None
      y = None
      h = None
      w = None

      def buttonA_wasPressed():
      global x, y, h, w
      V0.setTrackAreaCoordinate(140, 100, 40, 40)
      pass
      btnA.wasPressed(buttonA_wasPressed)

      Follow.setTitle('Follow the rabbit')
      V0 = unit.get(unit.TARGET_TRACE, unit.PORTB)
      while True:
      x = V0.getTrack_X()
      y = V0.getTrack_Y()
      h = V0.getTrack_Height()
      w = V0.getTrack_Width()
      label0.setText(str(x))
      label1.setText(str(y))
      rectangle0.setPosition(x, y)
      rectangle0.setSize(h, w)
      wait_ms(2)

      And getting the following error-Message:
      'module' object has no attribute 'TARGET_TRACE'

      1 Reply Last reply Reply Quote 0
      • First post
        Last post