Is the Zio Qwiic OLED display really 128 x 128?

I am using the u8g2 library to display on the Zio Qwiic OLED Display (1.5inch, 128x128) - SparkFun Electronics . The spec sheet says it’s 128 x 128, but I can only address (and see) 128 width x 96 height. My code is here: arduino-light-sensor/arduino-light-sensor/arduino-light-sensor.ino at master · chrisxkeith/arduino-light-sensor · GitHub, specifically in the OLEDWrapper class, in the various functions named test***N***(). Any idea what I’m doing wrong?

Many thanks,

Chris Keith

Here is a minimal program that demonstrates this. I ran it on a Sparkfun Artemis RedBoard with the display connected via QWIIC.

// Demonstrate that u8g2 library only displays 96 pixels height on Zio OLED

#include <U8g2lib.h>

U8G2_SSD1327_EA_W128128_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);

const int COLOR_WHITE = 1;

const int COLOR_BLACK = 0;

class OLEDWrapper {

public:

void u8g2_prepare(void) {

u8g2.setFont(u8g2_font_fur49_tn);

u8g2.setFontRefHeightExtendedText();

u8g2.setDrawColor(COLOR_WHITE);

u8g2.setFontDirection(0);

}

void startup() {

pinMode(10, OUTPUT);

pinMode(9, OUTPUT);

digitalWrite(10, 0);

digitalWrite(9, 0);

u8g2.begin();

u8g2.setBusClock(400000);

}

void startDisplay(const uint8_t *font) {

u8g2_prepare();

u8g2.clearBuffer();

u8g2.setFont(font);

}

void endDisplay() {

u8g2.sendBuffer();

}

void test() {

for (u8g2_uint_t h = 97; h >= 95; h–) {

startDisplay(u8g2_font_fur11_tf);

u8g2.drawFrame(0, 0, getWidth(), h);

u8g2.drawUTF8(8, 32, String(h).c_str());

endDisplay();

delay(2000);

  }

}

int getHeight() {

return 96; // ??? why does u8g2.getHeight() return 128 ???

}

int getWidth() {

return u8g2.getWidth();

}

};

OLEDWrapper* oledWrapper = new OLEDWrapper();

void setup() {

oledWrapper->startup();

}

void loop() {

oledWrapper->test();

}

1 Like