Closed flywire closed 3 years ago
you can set the width/height on instantiation, thats where the allocation happens as well.
Agree but it would be nicer to use like:
...
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
#define SCREEN_ADDRESS 0x3D ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
...
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
...
I'd be happy to do a PR.
that is not possible to do, a #define does not change the allocation inside the library
wait, do mean just changing the examples? or the API?
Just the examples so SCREEN_ADDRESS
(or preferred name) is identified more clearly.
oooh ok yes thats ok! sorry we get tons of people trying to change the API... yes a PR is welcome, please note it has to pass CI https://learn.adafruit.com/contribute-to-arduino-with-git-and-github
Define OLED address like Screen Width/Height rather than hard-coding.
https://github.com/adafruit/Adafruit_SSD1306/blob/master/examples/ssd1306_128x32_i2c/ssd1306_128x32_i2c.ino#L63
https://github.com/adafruit/Adafruit_SSD1306/blob/master/examples/ssd1306_128x64_i2c/ssd1306_128x64_i2c.ino#L59