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

    Invert X or Y blocks needed.

    Bug Report
    3
    4
    5.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.
    • ajb2k3A
      ajb2k3
      last edited by

      Just testing out UIFlow with the joystick and noticed that when using this code

      from m5stack import *
      from m5ui import *
      import units
      
      clear_bg(0x222222)
      joystick0 = units.Joystick(units.PORTA)
      
      
      
      btnA = M5Button(name="ButtonA", text="ButtonA", visibility=False)
      btnB = M5Button(name="ButtonB", text="ButtonB", visibility=False)
      btnC = M5Button(name="ButtonC", text="ButtonC", visibility=False)
      circle1 = M5Circle(159, 100, 15, 0xFFFFFF, 0xFFFFFF)
      
      
      while True:
        circle1.setPosition((joystick0.X), (joystick0.Y))
        wait(0.001)
      

      X axis or Y axis needs inverting to correct direction. (this code is just the micropython code generated by blocky.)

      Can we get a Inver X and Invert Y blocks added to the Joystick blocks please.

      UIFlow, so easy an adult can learn it!
      If I don't know it, be patient!
      I've ether not learned it or am too drunk to remember it!
      Author of the WIP UIFlow Handbook!
      M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

      m5-docsM 1 Reply Last reply Reply Quote 0
      • m5-docsM
        m5-docs @ajb2k3
        last edited by

        @heybin 我们可以加一个这样的block吗

        M5Stack documentation URL

        https://docs.m5stack.com

        1 Reply Last reply Reply Quote 0
        • H
          heybin
          last edited by

          sure, like joystick0.InverX and joystick0.InvertY

          ajb2k3A 1 Reply Last reply Reply Quote 1
          • ajb2k3A
            ajb2k3 @heybin
            last edited by

            @heybin Yes, some simple blocks with a function like that.

            UIFlow, so easy an adult can learn it!
            If I don't know it, be patient!
            I've ether not learned it or am too drunk to remember it!
            Author of the WIP UIFlow Handbook!
            M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

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