M5Flow Blockly Screen rotate issue
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)
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 22.214.171.124 and 1.5.2
Does anybody have any clue why this happens? Should the screen only be rotated once?
m5stack last edited by
thank you feedback. this bug we will fix as soon as possible
Thanks, much appreciated!
edenfy last edited by
Sorry for revive old post.
Any news about this?
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.
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.