Closed vitasam closed 5 years ago
I think a more useful change to the samples would be a new one written specifically for the limits of an AVR target. If you create a new sample such as that, I'll merge it.
I would like to see more info about your SH1106 pixel problem. Perhaps your display isn't really an SH1106.
Yes, AVR-specific example sounds good.
About my display - I bought this OLED module. According to specs, it is SH1106-compatible:
...
9, compatible with 3.3V and 5V control chip I / O level (without any set, directly compatible)
10, OLED screen, internal drive chip: SH1106 (Operation and SSD1306 same)
...
I've added some traces in to ss_oled.cpp:
// Detect the display controller (SSD1306 or SH1106)
uint8_t u = 0;
I2CReadRegister(oled_addr, 0x00, &u, 1); // read the status register
*regvalue = u;
*oledaddr = oled_addr;
Result is:
OLED address:0x3C
Register value:0x28
The simple_demo.ino sketch from /master does not show pixels, and after calling of oledSetPixel(x, y, 1, 1) loop the 0,0 coordinates seem to be shifted:
I've seen that occur when using the SetPixel function on SH1106 displays; I'll experiment and see if I can figure out what's happening.
I've seen that occur when using the SetPixel function on SH1106 displays; I'll experiment and see if I can figure out what's happening.
Ok, thanks! Do you want me to close this pull request and move SH1106 stuff in to a new Issue?
I found that I had not completed the changes of my last update and that I had accidentally disabled the SH1106 SetPixel code; it now works. I investigated the display offset error issue. For the demo sketch, it occurs when more than 2500 random pixels are drawn on the SH1106. The problem is that it's not consistent and appears to be a quirk of the controller. I cannot track down what the exact cause is. Draw fewer than 2500 random pixels and it doesn't occur. If I do a loop to individually set every pixel, it doesn't occur. It seems to be a specific sequence of pixels that causes the issue. You're still welcome to create a new example sketch specific to AVR.
Great! Now your default demo works. In my display the offsets sometimes occurred after 2000 random pixels, with a kind of vertical "glitch" in random columns:
But it is Ok for now. I will try to make an example for avr
I have replaced FONT_LARGE with FONT_STRETCHED (since _LARGE is disabled for AVR by default). Also I've found that oledSetPixel() does not work for my SH1106 @ 0x3C display, so I put it under if() for 'TODO' clarifications.