adafruit/Adafruit_SSD1306

New constructors ignore arguments

nonchip opened this issue · 1 comments

/* from the header file:
   Adafruit_SSD1306(uint8_t w, uint8_t h, TwoWire *twi = &Wire,
                   int8_t rst_pin = -1, uint32_t clkDuring = 400000UL,
                   uint32_t clkAfter = 100000UL);
*/
Adafruit_SSD1306 display(128, 64);
void setup(){
  display.begin(SSD1306_SWITCHCAPVCC,0x3C);
}
void loop(){
  display.clearDisplay();
  display.setCursor(0,0);
  display.setTextColor(WHITE,BLACK);
  display.setTextSize(2);
  display.setTextWrap(false);
  char buf[3];
  sprintf(buf,"%02d",display.height()); // <-- should return 64
  display.println(buf);
  display.display();
}

result:
image

the value is incorrectly 32, and every 2nd line is blank. interestingly though, it doesn't appear stretched vertically.

nevermind, sorry, arduino had some cached objects lying around it was using instead of my current code x_x