Shinichiro Nakamura / TextLCD_SR4

Dependents:   TextLCD_SR4_TestProgram ServoInterfaceBoardExample1

Embed: (wiki syntax)

« Back to documentation index

TextLCD_SR4 Class Reference

TextLCD_SR4 Class Reference

A TextLCD_SR4 interface for driving 4-bit HD44780-based LCDs with shift register. More...

#include <TextLCD_SR4.h>

Public Types

enum  LCDType { LCD16x2, LCD16x2B, LCD20x2, LCD20x4 }
 

LCD panel format.

More...

Public Member Functions

 TextLCD_SR4 (PinName rs, PinName e, PinName dat, PinName clk, LCDType type=LCD16x2)
 Create a TextLCD_SR4 interface.
int putc (int c)
 Write a character to the LCD.
int printf (const char *format,...)
 Write a formated string to the LCD.
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

A TextLCD_SR4 interface for driving 4-bit HD44780-based LCDs with shift register.

Currently supports 16x2, 20x2 and 20x4 panels

 #include "mbed.h"
 #include "TextLCD_SR4.h"

 TextLCD_SR4 lcd(p29, p30, p28, p27); // rs, e, dat, clk

 int main() {
     lcd.printf("Hello World!\n");
 }

Definition at line 28 of file TextLCD_SR4.h.


Member Enumeration Documentation

enum LCDType

LCD panel format.

Enumerator:
LCD16x2 

16x2 LCD panel (default)

LCD16x2B 

16x2 LCD panel alternate addressing

LCD20x2 

20x2 LCD panel

LCD20x4 

20x4 LCD panel

Definition at line 31 of file TextLCD_SR4.h.


Constructor & Destructor Documentation

TextLCD_SR4 ( PinName  rs,
PinName  e,
PinName  dat,
PinName  clk,
LCDType  type = LCD16x2 
)

Create a TextLCD_SR4 interface.

Parameters:
rsInstruction/data control line
eEnable line (clock)
datData line
clkClock line

Definition at line 31 of file TextLCD_SR4.cpp.


Member Function Documentation

void cls (  )

Clear the screen and locate to 0,0.

Definition at line 59 of file TextLCD_SR4.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 65 of file TextLCD_SR4.cpp.

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

Write a formated string to the LCD.

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 LCD.

Parameters:
cThe character to write to the display