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

    M5Flow Blockly Screen rotate issue

    M5Stack Fire
    5
    7
    9.9k
    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.
    • S
      sjako
      last edited by

      If I develop a simple Blockly (M5Flow) layout for rotating the screen, this does not work. When I look at the underlying Python code I noticed the "lcd.setRotation()" code ends up at the start of the code, and not at the spots where I would expect it (for this example in the button code blocks)

      Blockly Code:
      0_1590177150236_944a0098-9359-4515-9362-d286beb9aaf9-image.png

      Python Code:

      from m5stack import *
      from m5ui import *
      from uiflow import *
      lcd.setRotation(1)
      lcd.setRotation(3)
      
      setScreenColor(0x222222)
      
      label0 = M5TextBox(123, 111, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)
      
      def buttonA_wasPressed():
        # global params
        pass
      btnA.wasPressed(buttonA_wasPressed)
      
      def buttonB_wasPressed():
        # global params
        pass
      btnB.wasPressed(buttonB_wasPressed)
      

      If I copy/paste the "lcd.setRotation()" code blocks into the button blocks, the code works properly on the device. But when I switch back to Blockly, this solution is reverted. I'm having this issue with firmwares 1.4.5.1 and 1.5.2

      S 1 Reply Last reply Reply Quote 0
      • S
        sjako @sjako
        last edited by

        Does anybody have any clue why this happens? Should the screen only be rotated once?

        1 Reply Last reply Reply Quote 0
        • m5stackM
          m5stack
          last edited by

          thank you feedback. this bug we will fix as soon as possible

          E 1 Reply Last reply Reply Quote 0
          • S
            sjako
            last edited by

            Thanks, much appreciated!

            1 Reply Last reply Reply Quote 0
            • E
              edenfy @m5stack
              last edited by

              @m5stack

              Sorry for revive old post.

              Any news about this?

              1 Reply Last reply Reply Quote 0
              • ajb2k3A
                ajb2k3
                last edited by

                There should be an initial Set Rotation should always be at the start in the setup phase before the main loop.

                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
                • R
                  robalstona
                  last edited by

                  Just calling the screenrotate function will not rotate the already drawn screen contents. Just after using this function, the rest of the graphic functions will draw on the screen in a different orientation. So it seems to me that where this instruction does not need to be right at the beginning of the program.

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