public class SSD1306 extends SsdOled
128x64 Dot Matrix OLED/PLED Segment/Common Driver (128 segments and 64 commons).
Segment = column (x), Common = row (y)
The size of the RAM is 128 x 64 bits (1024 bytes) and the RAM is divided into eight pages, from PAGE0 to PAGE7, which are used for monochrome 128x64 dot matrix display. Each page is 128 bytes.
COM Page COM (Row re-mapping) 0-7 0 63-56 8-15 1 55-48 16-23 2 47-40 24-31 3 39-32 32-39 4 31-24 40-47 5 23-16 48-55 6 15-8 56-63 7 7-0 Segment 0 ..... 127 Segment 127 ..... 0 (Column re-mapping)
A byte of data in GDDRAM represents values for all rows of the current column and page.
Enlargement of GDDRAM for Page 2 (No row re-mapping and column-remapping): Each + represents one bit of image data.
1 1 1 1 1 <- Segment -> 2 2 2 2 2 D 0 1 2 3 4 5 ... 3 4 5 6 7 COM LSB 0 + + + + + + + + + + + + + 16 1 + + + + + + + + + + + + + 17 2 + + + + + + + + + + + + + 18 3 + + + + + + + + + + + + + 19 4 + + + + + + + + + + + + + 20 5 + + + + + + + + + + + + + 21 6 + + + + + + + + + + + + + 22 MSB 7 + + + + + + + + + + + + + 23
Wiring
GND .... Ground Vcc .... 3v3 D0 .... SCLK (SPI) D1 .... MOSI (SPI) RES .... Reset (GPIO) [27] DC .... Data/Command Select (GPIO) [22] CS .... Chip Select (SPI)
Links
Constructor and Description |
---|
SSD1306(int controller,
int chipSelect,
DigitalOutputDevice dcPin,
DigitalOutputDevice resetPin) |
Modifier and Type | Method and Description |
---|---|
void |
display(BufferedImage image) |
void |
display(BufferedImage image,
int threshold) |
protected void |
goTo(int x,
int y) |
protected void |
home() |
protected void |
init() |
void |
invertDisplay(boolean invert)
Sets if the display should be inverted
|
void |
setContrast(byte contrast)
Sets the display contract.
|
void |
setPixel(int x,
int y,
boolean on) |
public SSD1306(int controller, int chipSelect, DigitalOutputDevice dcPin, DigitalOutputDevice resetPin)
public void display(BufferedImage image)
public void display(BufferedImage image, int threshold)
public void setPixel(int x, int y, boolean on)
public void setContrast(byte contrast)
contrast
- Contrastpublic void invertDisplay(boolean invert)
invertDisplay
in class SsdOled
invert
- Invert stateCopyright © 2016–2018 mattjlewis. All rights reserved.