Skip to content

Commit

Permalink
Add SSD1306_96x16 display
Browse files Browse the repository at this point in the history
  • Loading branch information
greiman committed Sep 29, 2018
1 parent da3fd99 commit 6d277c2
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SSD1306Ascii
version=1.2.1
version=1.2.2
author=Bill Greiman <[email protected]>
maintainer=Bill Greiman <[email protected]>
sentence=Text display on small momochrome OLED modules.
Expand Down
2 changes: 1 addition & 1 deletion src/SSD1306Ascii.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "fonts/allFonts.h"
//------------------------------------------------------------------------------
/** SSD1306Ascii version */
#define SDD1306_ASCII_VERSION 1.2.1
#define SDD1306_ASCII_VERSION 1.2.2
//------------------------------------------------------------------------------
// Configuration options.
/** Set Scrolling mode for newline.
Expand Down
34 changes: 34 additions & 0 deletions src/SSD1306init.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
#define SSD1306_SETDISPLAYCLOCKDIV 0xD5
/** Set Pre-charge Period */
#define SSD1306_SETPRECHARGE 0xD9
/** Deactivate scroll */
#define SSD1306_DEACTIVATE_SCROLL 0x2E
/** No Operation Command. */
#define SSD1306_NOP 0XE3
//------------------------------------------------------------------------------
Expand Down Expand Up @@ -142,6 +144,38 @@ static const DevType MEM_TYPE MicroOLED64x48 = {
32
};
//------------------------------------------------------------------------------
// this section is based on
// https://github.com/olikraus/u8g2/blob/master/csrc/u8x8_d_ssd1306_96x16.c
/** Initialization commands for a 96x16 SSD1306 oled display. */
static const uint8_t MEM_TYPE SSD1306_96x16init[] = {
// Init sequence for Generic 96x16 OLED module
SSD1306_DISPLAYOFF,
SSD1306_SETDISPLAYCLOCKDIV, 0x80, // clock divide ratio and osc frequency
SSD1306_SETMULTIPLEX, 0x0F, // multiplex ratio
SSD1306_SETDISPLAYOFFSET, 0x0, // display offset zero
SSD1306_SETSTARTLINE | 0x0, // set display start line to 0
SSD1306_CHARGEPUMP, 0x14, // charge pump setting enable
SSD1306_MEMORYMODE, 0x00, // page addressing mode
SSD1306_SEGREMAP | 0xA1, // segment remap
SSD1306_COMSCANDEC, // scan dir reverse
SSD1306_SETCOMPINS, 0x02, // com pin HW config
SSD1306_SETCONTRAST, 0xAF, // set contrast level 0xaf
SSD1306_SETPRECHARGE, 0xF1, // pre-charge period 0x0f1
SSD1306_SETVCOMDETECT, 0x20, // vcomh deselect level
SSD1306_DEACTIVATE_SCROLL, // Deactivate scroll
SSD1306_DISPLAYALLON_RESUME,
SSD1306_NORMALDISPLAY,
SSD1306_DISPLAYON
};
/* Initialize a 96x16 SSD1306 oled display. */
static const DevType MEM_TYPE SSD1306_96x16 = {
SSD1306_96x16init,
sizeof(SSD1306_96x16init),
96,
16,
0
};
//------------------------------------------------------------------------------
// this section is based on https://github.com/adafruit/Adafruit_SSD1306
/** Initialization commands for a 128x32 SSD1306 oled display. */
static const uint8_t MEM_TYPE Adafruit128x32init[] = {
Expand Down

0 comments on commit 6d277c2

Please sign in to comment.