.edited to work on 128x64 display. .added preamble per page address (character rows)

Revision:
19:fdb58b689175
Parent:
18:a267f00528be
--- a/Adafruit_SSD1306.h	Tue Feb 07 23:52:12 2017 +0000
+++ b/Adafruit_SSD1306.h	Fri Jul 16 08:27:47 2021 +0000
@@ -41,7 +41,7 @@
 class Adafruit_SSD1306 : public Adafruit_GFX
 {
 public:
-	Adafruit_SSD1306(uint8_t rawHeight = 32, uint8_t rawWidth = 128)
+	Adafruit_SSD1306(uint8_t rawHeight = 64, uint8_t rawWidth = 128)
 		: Adafruit_GFX(rawWidth,rawHeight)
 	{
 		buffer.resize(rawHeight * rawWidth / 8);
@@ -89,7 +89,7 @@
 	 * @param rawHeight - The vertical number of pixels for the display, defaults to 32
 	 * @param rawWidth - The horizonal number of pixels for the display, defaults to 128
 	 */
-	Adafruit_SSD1306_I2c(I2C &i2c, uint8_t i2cAddress = SSD_I2C_ADDRESS, uint8_t rawHeight = 32, uint8_t rawWidth = 128)
+	Adafruit_SSD1306_I2c(I2C &i2c, uint8_t i2cAddress = SSD_I2C_ADDRESS, uint8_t rawHeight = 64, uint8_t rawWidth = 128)
 	    : Adafruit_SSD1306(rawHeight, rawWidth)
 	    , mi2c(i2c)
 	    , mi2cAddress(i2cAddress)
@@ -124,6 +124,12 @@
 		// send display buffer in 16 byte chunks
 		for(uint16_t i=0, q=buffer.size(); i<q; i+=16 ) 
 		{	uint8_t x ;
+            
+            if(i%(128)==0){
+                command(0xB0 + (i/128)); // page#
+                command(0x02); // low column
+                command(0x10); // high column
+            }
 
 			// TODO - this will segfault if buffer.size() % 16 != 0
 			for(x=1; x<sizeof(buff); x++)