Benny Andersen / microbitOLED

Dependencies:   microbit

Embed: (wiki syntax)

« Back to documentation index

OLED Class Reference

OLED Class Reference

Representation of a 128x64 pixels, SSD1306 compatibel OLED display. More...

#include <OLED.h>

Public Member Functions

 OLED ()
 ssd1306 compatible device of 128x64 pixels OLED display.
void init ()
 Initialisere display and clears it.
void clear ()
 Clears the display.
void newLine ()
 Makes a newline by incrementing charY and assigning xOffset to charX
if charY becomes 8 the display screen is scrolled one line and charY
is decremented to 7.
void drawChar (uint8_t x, uint8_t y, uint8_t chr)
 Put a char on display.
void puts (string str)
 Writes a string at charX, charY position.
uint8_t printf (const char *frmt,...)
 printf - the old classic.
void scroll ()
 Scroll the display one line.

Detailed Description

Representation of a 128x64 pixels, SSD1306 compatibel OLED display.

Definition at line 313 of file OLED.h.


Constructor & Destructor Documentation

OLED (  )

ssd1306 compatible device of 128x64 pixels OLED display.

Init() must be called after construction.
Works for some untraced circumstances not in fibers

Definition at line 8 of file OLED.cpp.


Member Function Documentation

void clear (  )

Clears the display.

Definition at line 66 of file OLED.cpp.

void drawChar ( uint8_t  x,
uint8_t  y,
uint8_t  chr 
)

Put a char on display.

The font represent display characters as 6x8 pixels areas (6 horizontal).
The font does actual contain 5 colums - the six'd makes characters
seperation. Character values 0, 0x20, and 0xff are bitpatterns with
all null pixels (like space)

Parameters:
xhorizontal pixelwise position, range [0,displayWidth - 6]
yvertical position, range [0,7]
chrcharacter to put on display

Definition at line 87 of file OLED.cpp.

void init (  )

Initialisere display and clears it.

A buffer representing charaters are filled with space characters.

Definition at line 25 of file OLED.cpp.

void newLine (  )

Makes a newline by incrementing charY and assigning xOffset to charX
if charY becomes 8 the display screen is scrolled one line and charY
is decremented to 7.

pendingNewline=false is done at last.

Definition at line 120 of file OLED.cpp.

uint8_t printf ( const char *  frmt,
  ... 
)

printf - the old classic.

\n and \r is processed.
\n includes \r functionality.
This function is the main reason to that OLED not works in fibers.

Definition at line 147 of file OLED.cpp.

void puts ( string  str )

Writes a string at charX, charY position.

Afterwards are
charX, charY set to the next starting point for writting to display
\n and \r is processed - \n includes \r functionality.

Parameters:
strto be displayed at (charX, charY).

Definition at line 130 of file OLED.cpp.

void scroll (  )

Scroll the display one line.

Definition at line 114 of file OLED.cpp.