lexus2k / ssd1306

Driver for SSD1306, SSD1331, SSD1351, IL9163, ILI9341, ST7735, PCD8544, Nokia 5110 displays running on Arduino/ESP32/Linux (Rasperry) platforms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

drawLinesDemo Bug

AndreiCo14 opened this issue · comments

Describe the bug
See screenshots. Lines is broken.

To Reproduce
Steps to reproduce the behavior:

  1. Upload ssd1306_demo.ino
  2. the result of the "draw lines" menu

Expected behavior
Draw lines.

Screenshots
photo_2019-03-16_21-36-32

Please complete the following information:

  • library version 1.7.16
  • LCD display ssd1306 0.96 I2C
  • OS windows
  • Platform wemos d1 mini
  • IDE Arduino 1.8.5

Additional context

Hello,

Actually, this is not a bug, but expected behavior on these types of displays (based on ssd1306 controllers). This happens, because oled display doesn't allow to address single pixel. Each byte in ssd1306 controller represents 8 vertical pixels. So, for example, if it is required to draw horizontal line 4 pixels length at [0,2], library sends four bytes to ssd1306 (0x04,0x04,0x04,0x04). And then you need another horizontal line at [0,4], so the library needs to send another four bytes (0x10,0x10,0x10,0x10), and new bytes completely overwrite previous ones. So, you will see only one line, but not two.
Unfortunately there is no way to read old bytes from oled display of this type. So, the only way out for you here is to use double buffering, what is supported by ssd1306 library.
Please, refer to examples.

If you have any ideas how to solve your problem, let me know

I understood. Thanks!