From aa728fb0daeba1c4c15b2514acbbd0fadb8f9cda Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 16 Apr 2021 20:25:24 +0200 Subject: ssd1306: reset column and page pointer on initialization --- include/driver/ssd1306.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/driver/ssd1306.h b/include/driver/ssd1306.h index e439ca6..1c2ff1a 100644 --- a/include/driver/ssd1306.h +++ b/include/driver/ssd1306.h @@ -96,7 +96,7 @@ class SSD1306 { // height == 32? 0x02 : 0x12 - const unsigned char init3[13] = { + const unsigned char init3[19] = { /* * Set clock to recommended values: 370 kHz (bits 7..4), * no divider (bits 3..0). Increase divider for glitchy effects. @@ -133,7 +133,13 @@ class SSD1306 { SSD1306_SET_CHARGE_PUMP, 0x14, // turn on display - SSD1306_SET_DISP | 0x01 + SSD1306_SET_DISP | 0x01, + + // reset column pointer + SSD1306_SET_COL_ADDR, 0, 127, + + // reset page pointer + SSD1306_SET_PAGE_ADDR, 0, 7 }; void writeCommand(uint8_t command); -- cgit v1.2.3