Skip to content

Commit c76fc1f

Browse files
committed
1.2.6
1 parent d8bfeeb commit c76fc1f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Adafruit_SSD1306.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ All text above, and the splash screen must be included in any redistribution
3030
#include <vector>
3131
#include <algorithm>
3232

33+
3334
// A DigitalOut sub-class that provides a constructed default state
3435
class DigitalOut2 : public DigitalOut
3536
{
@@ -42,6 +43,8 @@ class DigitalOut2 : public DigitalOut
4243

4344
#define SSD1306_EXTERNALVCC 0x1
4445
#define SSD1306_SWITCHCAPVCC 0x2
46+
#define SSD1306_COLUMNADDR 0x21
47+
#define SSD1306_PAGEADDR 0x22
4548

4649
/** The pure base class for the SSD1306 display driver.
4750
*
@@ -128,6 +131,13 @@ class Adafruit_SSD1306_I2c : public Adafruit_SSD1306
128131
protected:
129132
virtual void sendDisplayBuffer()
130133
{
134+
command(SSD1306_PAGEADDR);
135+
command(0x0);
136+
command(0xFF);
137+
command(SSD1306_COLUMNADDR);
138+
command(0x0);
139+
command(_rawWidth - 1);
140+
131141
char buff[17];
132142
buff[0] = 0x40; // Data Mode
133143

@@ -140,6 +150,7 @@ class Adafruit_SSD1306_I2c : public Adafruit_SSD1306
140150
buff[x] = buffer[i+x-1];
141151
mi2c.write(mi2cAddress, buff, sizeof(buff));
142152
}
153+
143154
};
144155

145156
MicroBitI2C mi2c;

pxt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "SSD1306_OLED",
3-
"version": "1.2.5",
3+
"version": "1.2.6",
44
"description": "Tinkercademy package for SSD1306 OLED controller",
55
"license": "MIT",
66
"dependencies": {

0 commit comments

Comments
 (0)