datacute / Tiny4kOLED

Library for an ATTiny85 to use an SSD1306 powered, double buffered, 128x32 pixel OLED, over I2C
MIT License
247 stars 36 forks source link

Add SH1106 132x64 display support #32

Open Deoptim opened 3 years ago

Deoptim commented 3 years ago

Hello. I post this adapted library (ad58375 on Aug 29) for the SH1106 controller. Made it possible not to use (delete) unsupported functions if the parameter "#define SH1106" is defined in the Tiny4kOLED_common.h file. Applicable for SH1106 controller as there are slight differences from SSD1306. I made this library for myself. Thanks. Tiny4kOLED-ad58375.zip

hameed-maleki commented 2 years ago

Hello. I post this adapted library (ad58375 on Aug 29) for the SH1106 controller. Made it possible not to use (delete) unsupported functions if the parameter "#define SH1106" is defined in the Tiny4kOLED_common.h file. Applicable for SH1106 controller as there are slight differences from SSD1306. I made this library for myself. Thanks. Tiny4kOLED-ad58375.zip

how can use your castum library? i use inport your library and used sh1106 display not chenged? The corner of the combo image still has pixel clutter ![Uploading 16521336580755597869875827660376.jpg…]()

hameed-maleki commented 2 years ago

![Uploading Screenshot_2022-05-10-02-53-55-016_com.miui.gallery.jpg…]()

Deoptim commented 2 years ago

@hamedmalekii Hello, Are you use this initial sequence:

oled.begin(132, 64, sizeof(tiny4koled_init_132x64), tiny4koled_init_132x64);
oled.clear();
oled.on();
oled.init();

?

Note that the width here is 132 instead of 128...

hameed-maleki commented 2 years ago

@hamedmalekii Hello, Are you use this initial sequence:

oled.begin(132, 64, sizeof(tiny4koled_init_132x64), tiny4koled_init_132x64);
oled.clear();
oled.on();
oled.init();

?

Note that the width here is 132 instead of 128... I did not use this command. My DISPLAY is SH1106 128 X 64 pixels, but I still need the command Can I enter a132 pixel?

hameed-maleki commented 2 years ago

@hamedmalekii Hello, Are you use this initial sequence:

oled.begin(132, 64, sizeof(tiny4koled_init_132x64), tiny4koled_init_132x64);
oled.clear();
oled.on();
oled.init();

?

Note that the width here is 132 instead of 128...

I use this order (132, 64, sizeof(tiny4koled_init_132x64), tiny4koled_init_132x64); but the display is upside down Is there a way to solve it?

hameed-maleki commented 2 years ago

@datacute i use this order (132, 64, sizeof(tiny4koled_init_132x64), tiny4koled_init_132x64); but the display is upside down Is there a way to solve it? #

hameed-maleki commented 2 years ago

@hamedmalekii Hello, Are you use this initial sequence:

oled.begin(132, 64, sizeof(tiny4koled_init_132x64), tiny4koled_init_132x64);
oled.clear();
oled.on();
oled.init();

?

Note that the width here is 132 instead of 128... @datacute hi i use this order (132, 64, sizeof(tiny4koled_init_132x64), tiny4koled_init_132x64); but the display is upside down Is there a way to solve it?

Deoptim commented 2 years ago

@hamedmalekii The first thing I advise you to do is to check the display that it works at all - on Arduino with some library and take an example of rendering.

Oled

There, by default, this SH1106 display is already selected. SDA and SCL are standard for Arduino

GyverOLED

Or this, also by default used SH1106

datacute commented 2 years ago

@hamedmalekii are you using Deoptim's code or the latest version of my code? The latest version of my code will probably mostly work if you use the begin method that specifies the offsets and size, but use the init sequence for the 128x64 SSD1306:

oled.begin(2, 0, 132, 64, sizeof(tiny4koled_init_128x64), tiny4koled_init_128x64);

There is also a function to rotate 180 degrees:

oled.setRotation(1)

(try both 1 and 0)

hameed-maleki commented 2 years ago

@hamedmalekii are you using Deoptim's code or the latest version of my code? The latest version of my code will probably mostly work if you use the begin method that specifies the offsets and size, but use the init sequence for the 128x64 SSD1306:

oled.begin(2, 0, 132, 64, sizeof(tiny4koled_init_128x64), tiny4koled_init_128x64);

There is also a function to rotate 180 degrees:

oled.setRotation(1)

(try both 1 and 0)

thanks i try it

hameed-maleki commented 1 year ago

@hamedmalekii are you using Deoptim's code or the latest version of my code? The latest version of my code will probably mostly work if you use the begin method that specifies the offsets and size, but use the init sequence for the 128x64 SSD1306:

oled.begin(2, 0, 132, 64, sizeof(tiny4koled_init_128x64), tiny4koled_init_128x64);

There is also a function to rotate 180 degrees:

oled.setRotation(1)

(try both 1 and 0)

dont work after use oled.setRotation(1) i have this error

exit status 1 expected ';' before 'oled'

SpenceKonde commented 1 year ago

This issue clearly appears to be a missing ; on the line immediately preceding that line. It has likely been solved by now, and is probably closable.