smd.iotkit.ch / OLEDDisplay

Dependents:   UltraschallSensor_LowLevelV2

Embed: (wiki syntax)

« Back to documentation index

OLEDDisplay Class Reference

OLEDDisplay Class Reference

OLED Display. More...

#include <OLEDDisplay.h>

Public Member Functions

void clear ()
 clear Display
void setRotation (uint8_t r)
 Set the display rotation, 1 = down, 2 = up, 3 = left, or 4 = right.
void printf (const char *format,...)
 printf formatted with display
void cursor (int16_t y, int16_t x)
 Set the text cursor location, based on the size of the text.

Detailed Description

OLED Display.

Vereinfachte Version zur Ansteuerung eines Displays auf Basis von I2C und SSD1306 Interface

Example:

 #include "mbed.h"
 #include "OLEDDisplay.h"
 
 DigitalOut led( D10 );
 OLEDDisplay oled;
 
 int main()
 {
     int i = 0;
     oled.clear();
     oled.printf( "Test\r\n" );
     
     while (true) 
     {
         oled.cursor( 1, 0 );
         oled.printf( "ON %d, %d\n", led.read(), i );
         led = 1;
         wait( 1.0f ); 
         
         oled.cursor( 2, 0 );
         oled.printf( "OFF %d, %d\n", led.read(), i );
         led = 0;
         i++;
         wait( 1.0f );
     }
 }

Definition at line 60 of file OLEDDisplay.h.


Member Function Documentation

void clear (  )

clear Display

Definition at line 68 of file OLEDDisplay.h.

void cursor ( int16_t  y,
int16_t  x 
)

Set the text cursor location, based on the size of the text.

Definition at line 94 of file OLEDDisplay.h.

void printf ( const char *  format,
  ... 
)

printf formatted with display

Definition at line 80 of file OLEDDisplay.h.

void setRotation ( uint8_t  r )

Set the display rotation, 1 = down, 2 = up, 3 = left, or 4 = right.

Definition at line 74 of file OLEDDisplay.h.