Graphic OLED 100x16 pixels interface

Dependents:   mbed_nicovideo_search_api mbed_recent_nicovideo_display_pub

Embed: (wiki syntax)

« Back to documentation index

GraphicOLED Class Reference

GraphicOLED Class Reference

GraphicOLED interface for WS0010. More...

#include <GraphicOLED.h>

Public Member Functions

 GraphicOLED (PinName rs, PinName e, PinName d4, PinName d5, PinName d6, PinName d7)
 Create a GraphicOLED interface.
int putc (int c)
 Write a character to the OLED.
int printf (const char *format,...)
 Write a formated string to the OLED.
void locate (int column, int row)
 Locate to a screen column and row.
void cls ()
 Clear the screen and locate to 0,0.

Detailed Description

GraphicOLED interface for WS0010.

Currently support UTF-8 KANJI(misaki font)

 #include "mbed.h"
 #include "GraphicOLED.h"
 
 GraphicOLED oled(p24, p26, p27, p28, p29, p30); // rs, e, d4-d7
 
 int main() {
     oled.printf("Hello World!\n");
 }

Definition at line 20 of file GraphicOLED.h.


Constructor & Destructor Documentation

GraphicOLED ( PinName  rs,
PinName  e,
PinName  d4,
PinName  d5,
PinName  d6,
PinName  d7 
)

Create a GraphicOLED interface.

Parameters:
rsInstruction/data control line
eEnable line (clock)
d4-d7Data lines for using as a 4-bit interface

Definition at line 7 of file GraphicOLED.cpp.


Member Function Documentation

void cls (  )

Clear the screen and locate to 0,0.

Definition at line 59 of file GraphicOLED.cpp.

void locate ( int  column,
int  row 
)

Locate to a screen column and row.

Parameters:
columnThe horizontal position from the left, indexed from 0
rowThe vertical position from the top, indexed from 0

Definition at line 69 of file GraphicOLED.cpp.

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

Write a formated string to the OLED.

Parameters:
formatA printf-style format string, followed by the variables to use in formating the string.
int putc ( int  c )

Write a character to the OLED.

Parameters:
cThe character to write to the display