Hi speed refresh specific area at SSD1306?

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
User avatar
water
Posts: 75
Joined: Sun Sep 24, 2017 9:16 am

Hi speed refresh specific area at SSD1306?

Post by water » Wed Jan 27, 2021 1:38 pm

In some SSD1306 use case, just need to change specific area contents only, or likes Arduino serial
plotter scroll the graphic from right to left, if use SSD1306.fill(0) then redraw entire(full screen) graphic,
it will be slow and blinking extremely, someone could give some examples by other better methods with these cases?

Image

Image

Per area has different refresh frequency. (n1, n2 ...)

Code: Select all

def refresh_oled_area_1():
	while True:
#		use oled.pixel() set area 1 pixel to '0'
		oled.text('area 1 contents', x1, y1)
		oled.show()
		sleep(n1)

Code: Select all

def refresh_oled_area_2():
	while True:
#		use oled.pixel() set area 2 pixel to '0'
		oled.text('area 1 contents', x2, y2)
		oled.show()
		sleep(n2)

...

Code: Select all

_thread.start_new_thread(refresh_oled_area_1, ())
_thread.start_new_thread(refresh_oled_area_2, ())

Post Reply