pimoroni / picovision

MIT License
46 stars 15 forks source link

set_scroll_idx_for_lines only index '2' works #49

Closed technolhodgy closed 1 year ago

technolhodgy commented 1 year ago

How ever I order my code and scroll sections, only index'2' scrolls

Using a minimal 'picovision-boilerplate' and filling the screen with text to see how things scroll. ( if I re-order the index's of 'display.set_scroll_idx_for_lines' I can make a different part of the screen scroll ( but it is still only index '2' that scrolls )

setup part: display.set_scroll_idx_for_lines(0, 0, 160); display.set_scroll_idx_for_lines(1, 160, 320); display.set_scroll_idx_for_lines(2, 320, 480); //display.set_scroll_idx_for_lines(3, 440, 480); display.setup_scroll_group(Point(0, 0),0,640,160,0,0); display.setup_scroll_group(Point(0,0),1,640,320,0,160); display.setup_scroll_group(Point(0,0),2,640,480,0,320); //display.setup_scroll_group(Point(0,320),3,640,500,0,440);

Loop part: while(true) { for (x=0; x <160;x++) { display.setup_scroll_group(Point(0, x),0,0,160,640,0); display.setup_scroll_group(Point(0,160-x),1,0,320,640,160); display.setup_scroll_group(Point(0, x),2,0,480,640,320); // this one works //display.setup_scroll_group(Point(0, 0),3,0,500,640,440); sleep_ms(15); } }

MichaelBell commented 1 year ago

setup_scroll_group shouldn't be called for index 0 (scroll group 0 is the default and can't be scrolled). I should add some range checking.

Setting it is likely to break scroll group 1, but I don't immediately see how it would stop scroll group 1 from working given that you set it immediately afterwards though. Maybe something gets in a bad state? Or maybe there is another issue.

MichaelBell commented 1 year ago

I've quickly tested this from MicroPython and a similar setup appears to be working for me. One gotcha is that you have to call set_scroll_idx_for_lines on both PSRAMs, so call it twice with a flip in between. Though given that one of the scroll groups does work I guess it's not that that's gone wrong!

technolhodgy commented 1 year ago

I already do that for (f = 0; f<2;f++) { blah Something Something picovisiony... display.flip(); }

I had added main-demo.cpp to my project ( so you can see the whole thing, but needs '#' change to CMakelists.txt to make)

MichaelBell commented 1 year ago

Thanks for the repro case - I had missed something when increasing the maximum number of scroll groups. Should be fixed by the linked PR.

technolhodgy commented 1 year ago

Awesome that fixed it.

https://github.com/pimoroni/picovision/assets/37250167/49560310-710a-4809-9027-cbbeea454c99