O ile 0,96" idealnie udało się wstawić i działa na I2C bez problemu (na razie jeszcze nie w drukarce), to 1,3" (wzrok już nie ten) jest problem.
Dla spostrzegawczych porównanie:
0,96" 1,3" Udało mi się pozbyć bocznego paska ustawiając w u8glib_ex.h linia 2674:
Kod: Zaznacz cały
#define WIDTH 132
Kod: Zaznacz cały
#define WIDTH 128
Nie ukrywam, że liczę na Ciebie @dziobu
Generalnie prawdopodobnie problem wynika z tego, że wyświetlacz 1,3" to SH1106, a 0,96" to SSD1306, choć podobno można je zamiennie stosować. SH1106 nie ma w u8glib wsparcia I2C. W testowych projektach nie ma tego przesunięcia, więc pewnie znowu coś z kodzie Repetiera jest namieszane :/
Pinologia prosta:
0,96"
VCC do 3,3V
GND do GND
SDA do SDA
SCL do SCL
1,3"
1. przelutowanie zworek: BS0 na 0, BS1 na 1
2. RS do reset (przy 3,3V)
3. D/C w powietrzu
4. CS do GND
5. CLK do SCL
6. DIN do SDA
7. GND do GND
8. VCC do 3,3V
Zmiany w repetierze:
1. w Configuration.h
Kod: Zaznacz cały
#define FEATURE_CONTROLLER 1
2. w uiconfig.h odkomentowana linia 120:
Kod: Zaznacz cały
#define U8GLIB_SSD1306_I2C
Kod: Zaznacz cały
//#define U8GLIB_ST7920
Kod: Zaznacz cały
#define UI_DISPLAY_I2C_ADDRESS 0x3C
Jeszcze jedno, znalazłem to, ale nie bardzo wiem, jak ten shift ustawić, dlatego pytam:
https://forum.arduino.cc/index.php?topic=256374.0 cytuję:
Re: What's the difference between Adafruit SSD1306 and SH1106?
#4
Jul 22, 2014, 09:03 pm
There is only one small difference between SSD1306 and SH1106: The SH1106 controller has an internal RAM of 132x64 pixel. The SSD1306 only has 128x64 pixel.
First problem for standard 128x64 OLEDs with SH1106 controller is: How is the 128x64 window mapped into the 132x64 RAM?
It seems, that the 128x64 OLED is centered in most cases within the 132x64 area, that means pixel (2,0) in ram is pixel (0,0) on the display.
For u8glib, the update for the SH1106 was very small. I just had to shift the display by 2 pixel. This is more complicated with the Adafruit lib. Mainly the procedure "Adafruit_SSD1306::display(void)" depends very much on the hardware architecture and assumes, that the width of the RAM area is 128 (which is wrong for the SH1106). I think the procedure Adafruit_SSD1306::display(void) needs to be rewritten completly (including the commands, which are sent).
Oliver