ssd1306 oled: scroll repeats edge pixels
ssd1306 oled: scroll repeats edge pixels
Hey. When I scroll screen using scroll(x,y), if there were any pixels touching the edge of the screen it repeats them over and over. Is there any way to avoid this?
Re: ssd1306 oled: scroll repeats edge pixels
Did you find a solution to this? I saw something similar when playing around with a scrolling heart-beat display, but can't remember how I solved it. I think in the end I may have been drawing over the end of the screen buffer when attempting to draw the pixels to 'scroll in', or maybe I just started drawing at 1px in from the edge.
If you draw on the left and scroll left does it appear on the right?
If you draw on the left and scroll left does it appear on the right?
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: ssd1306 oled: scroll repeats edge pixels
I don't know if this is relevant but the framebuf scroll method does not erase pixels revealed by scrolling. So, for example, if you scroll down by 3 rows the top 3 rows will still contain the original pixels. This is by design.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: ssd1306 oled: scroll repeats edge pixels
The frame buffer scroll is like a copy-n-paste, resulting in artefacts like you described. Try scrolling 5px or 10px and it should make the effect more obvious.
The hardware scroll methods shifts the pointer to the display memory, resulting in pixel wrap around. You don’t have to scroll the entire display either. You can select a window. Have a look at the SSD1306 datasheet. There’s a bunch of commands you can call, unsupported by the native driver, which let you push pixels around.
The hardware scroll methods shifts the pointer to the display memory, resulting in pixel wrap around. You don’t have to scroll the entire display either. You can select a window. Have a look at the SSD1306 datasheet. There’s a bunch of commands you can call, unsupported by the native driver, which let you push pixels around.
Re: ssd1306 oled: scroll repeats edge pixels
The only solution to fix this, is just scrolling and then drawing empty rectangle in place, where garbage shows up.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: ssd1306 oled: scroll repeats edge pixels
Yes.
Take a look at the code. The way the framebuf scroll method works was a deliberate design decision. Personally I think an option to clear the revealed area would be a good idea. But the docs are quite clear about this effect.
Take a look at the code. The way the framebuf scroll method works was a deliberate design decision. Personally I think an option to clear the revealed area would be a good idea. But the docs are quite clear about this effect.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 9
- Joined: Thu May 28, 2020 5:40 pm
- Location: sorry for my English)
Re: ssd1306 oled: scroll repeats edge pixels
the problem is still not resolved