🤖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

    Scheduled Pinned Locked Moved UIFlow
    1 Posts 1 Posters 3.3k Views
    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 Offline
      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

      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