Posted November 5, 20204 yr Does anyone know of a method of getting some clarification on what the expected output of programs should be? I've tried going through LEGO Customer Service but I'm not really getting anyway (they also can't receive images / videos via the support emails so that makes it harder) I've been writing some small testing scripts to extract behaviours of the different micropython functions on the hub but some of the outcomes are odd. Here's an example in the app using the blocks: Or in micropython: from hub import display from utime import sleep display.pixel(0,0,100) sleep(1) display.rotation(90) sleep(1) display.pixel(0,0,100) sleep(1) display.rotation(-90) sleep(1) display.pixel(0,0,0) They both give the same results: While I would expect it to have done something like this:
November 5, 20204 yr You have to turn the pixles off manually I think. Otherwise they stay activated.
November 5, 20204 yr Author I'm happy with them staying activated, I'm just confused about what rotate is actually doing. I'd either expect it to rotate what's on the screen but not change the indexing of pixels (so 0,0 is always the top left) Or I'd expect it to rotate what's on the screen and change the indexing (so 0,0 would be the top right after a 90 degree rotation and it would be the bottom right after a 180 degree rotation) Neither of these is what happens. Edited November 5, 20204 yr by gw_shadow
November 5, 20204 yr I think display.rotation() is equivalent to the "set orientation to" block rather than the "rotate orientation" block.
November 5, 20204 yr Author I've tried that too. If I run this script: from hub import display from utime import sleep display.clear() sleep(1) display.pixel(0,0,100) sleep(1) display.rotation(90) sleep(1) display.pixel(0,0,100) sleep(1) display.rotation(90) sleep(1) display.pixel(0,0,100) sleep(1) display.rotation(90) sleep(1) display.pixel(0,0,100) sleep(1) display.rotation(90) sleep(1) I get this result: I'm at a loss. Ah, and if I run it twice in a row without doing a soft reset in between it does this... --- Edit: Ah the reason for the first result being super weird (jumping 180) seems to be some internal state that only gets applied after the first rotate call, if I do a hard reset then run the script it only jumps 90 and otherwise follows the same pattern as the final gif. Edited November 5, 20204 yr by gw_shadow
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.