Forked from Neal Horman: Adafruit_GFX, a derived version of the BSD licensed Adafrut GFX library for the SSD1306 controller for an OLED 128x32 or 128x64 display using SPI or I2C. Now it is adopted also for the SH1106 I2C 128x64 display as well...

Dependents:   Lab06_oled_i2c Lab06_BME280_oled Lab06_oled_clock I2C_SSD1306andSH1106_nucleo_F446RE

Revision:
10:d5aee2d2f8dd
Parent:
9:ddb97c9850a2
Child:
12:7964c2cfdebc
--- a/Adafruit_SSD1306.h	Sun Oct 19 20:55:27 2014 +0000
+++ b/Adafruit_SSD1306.h	Mon Oct 20 03:16:15 2014 +0000
@@ -48,7 +48,9 @@
 	Adafruit_SSD1306(PinName RST, uint8_t rawHeight = 32, uint8_t rawWidth = 128)
 		: Adafruit_GFX(rawWidth,rawHeight)
 		, rst(RST,false)
-	{};
+	{
+		buffer.resize(rawHeight * rawWidth / 8);
+	};
 
 	void begin(uint8_t switchvcc = SSD1306_SWITCHCAPVCC);
 	virtual void command(uint8_t c) = 0;