🤖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

    Scheduled Pinned Locked Moved M5Stack Fire
    7 Posts 5 Posters 12.8k Views 2 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.
    • S Offline
      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 Offline
        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 Offline
          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 Offline
            sjako
            last edited by

            Thanks, much appreciated!

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

              @m5stack

              Sorry for revive old post.

              Any news about this?

              1 Reply Last reply Reply Quote 0
              • ajb2k3A Offline
                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 Offline
                  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

                  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