ssd1306 display scroll
ssd1306 display scroll
Hi, i am looking the ssd1306 display library and I see that it has a method called scroll, I thought that this method scrolls all the pixels in my display but it doesn't work.
My code:
import ssd1306
from machine import I2C, Pin
import math
i2c = I2C(sda=Pin(4), scl=Pin(5))
display = ssd1306.SSD1306_I2C(64, 48, i2c, 60)
display.fill(0)
display.text("Hello",0,0,1)
display.show()
After that i try to scroll using
display.scroll(5,5)
display.show()
But it doesn't work.
Do you know how scroll works?
Thanks
My code:
import ssd1306
from machine import I2C, Pin
import math
i2c = I2C(sda=Pin(4), scl=Pin(5))
display = ssd1306.SSD1306_I2C(64, 48, i2c, 60)
display.fill(0)
display.text("Hello",0,0,1)
display.show()
After that i try to scroll using
display.scroll(5,5)
display.show()
But it doesn't work.
Do you know how scroll works?
Thanks
Re: ssd1306 display scroll
At the moment it only works when one of the arguments is 0.
Re: ssd1306 display scroll
It discards bits moved offscreen? or wraps?
Re: ssd1306 display scroll
By the way, that display has hardware scrolling capability, it would probably be better to use that.
Re: ssd1306 display scroll
Hi, Thanks for your answer, it works but only in Y scroll
means that this works:
display.scroll(0,10)
display.show()
but this not
display.scroll(10,0)
display.show()
deshipu: you said that the display has hardware scrolling capability, how it works? how can i achieve it?
Thank you guys
means that this works:
display.scroll(0,10)
display.show()
but this not
display.scroll(10,0)
display.show()
deshipu: you said that the display has hardware scrolling capability, how it works? how can i achieve it?
Thank you guys
-
- Posts: 4
- Joined: Thu Oct 20, 2016 7:15 pm
Re: ssd1306 display scroll
Hello,
I made a quick scroll-down function, not the smoothest scroll but for an ESP its good.
Here's the function
Here's how to use it (assuming that your SSD1306 screen is a variable called 'oled')
Hopefully it helps someone.... I will also integrate it in illuminOS
I made a quick scroll-down function, not the smoothest scroll but for an ESP its good.
Here's the function
Code: Select all
import time
def scroll_down_show(oled, line_to_show):
for y in range(0, -6, -1):
time.sleep(0.01)
oled.scroll(0, y)
if y == -5:
oled.text(line_to_show, 0, 15)
oled.show()
Code: Select all
for n in range(0,500):
scroll_down_show(oled, str(n))
Re: ssd1306 display scroll
How does the hardware scrolling work?
Here's how it works in an Arduino example:
https://github.com/adafruit/Adafruit_SS ... 6.cpp#L330
The hardware display buffer is 128x64, so if you are using the SSD1306 with a smaller OLED, such as the wemos 64x48 OLED, scrolling reveals parts of the buffer that were not being displayed, so you would need to scroll the software buffer instead and send it across.
Here's how it works in an Arduino example:
https://github.com/adafruit/Adafruit_SS ... 6.cpp#L330
The hardware display buffer is 128x64, so if you are using the SSD1306 with a smaller OLED, such as the wemos 64x48 OLED, scrolling reveals parts of the buffer that were not being displayed, so you would need to scroll the software buffer instead and send it across.
Re: ssd1306 display scroll
I modified the micropython SSD1306 library and added hardware scroll.
It seems to work great for me. Try it out.
https://github.com/timotet/SSD1306
It seems to work great for me. Try it out.
https://github.com/timotet/SSD1306
Re: ssd1306 display scroll
Please post a examples how to use horizontal scroll.
Awesome work.
Awesome work.
Last edited by bergpb on Fri May 08, 2020 8:11 pm, edited 1 time in total.