Extendes Version of TextLCD which scrolls oversized lines.

Dependents:   RF22_MAX_test_Send

Embed: (wiki syntax)

« Back to documentation index

TextLCDScroll Class Reference

TextLCDScroll Class Reference

TextLCDScroll class which handles horizontal scrolling text if it doesn't fit in one line, based on class TextLCD. More...

#include <TextLCDScroll.h>

Public Types

enum  ScrollModes { leftright, left }
 

How should we scroll horizontal in one line.

More...

Public Member Functions

 TextLCDScroll (PinName rs, PinName e, PinName d4, PinName d5, PinName d6, PinName d7, TextLCD::LCDType type)
 Create a TextLCDScroll Object with pins and Type from TextLCD.
bool setLine (int Line, char *str)
 Display a string str on line Line.
bool setSpeed (int speed)
 Set the speed, how fast to scroll the text in Characters per Second.
bool setScrollMode (ScrollModes mode)
 Set the Scroll-Mode.

Detailed Description

TextLCDScroll class which handles horizontal scrolling text if it doesn't fit in one line, based on class TextLCD.

Example:

 #include "TextLCDScroll.h"
 #include "mbed.h"

 TextLCDScroll lcd(p30, p29, p28, p27, p26, p25, TextLCD::LCD16x2); // rs, e, d0-d3

 int main() {

     lcd.cls();
     lcd.setLine(0,"TextLCDScroll!");
     lcd.setLine(1,"This line can be rather long. The quick brown fox jumps over the lazy dog.");
 }

Definition at line 46 of file TextLCDScroll.h.


Member Enumeration Documentation

How should we scroll horizontal in one line.

Enumerator:
leftright 

Scroll left ande the right.

left 

Scroll only left - default.

Definition at line 51 of file TextLCDScroll.h.


Constructor & Destructor Documentation

TextLCDScroll ( PinName  rs,
PinName  e,
PinName  d4,
PinName  d5,
PinName  d6,
PinName  d7,
TextLCD::LCDType  type 
)

Create a TextLCDScroll Object with pins and Type from TextLCD.

Parameters:
rsInstruction/data control line
eEnable line (clock)
d4-d7Data lines for using as a 4-bit interface
typeSets the panel size/addressing mode (default = LCD16x2)

Definition at line 5 of file TextLCDScroll.cpp.


Member Function Documentation

bool setLine ( int  Line,
char *  str 
)

Display a string str on line Line.

Replaces old text on this Line.

Parameters:
LineLine, where text should be displayed. first Line=0
*strthe string to display (c-string)

Definition at line 35 of file TextLCDScroll.cpp.

bool setScrollMode ( ScrollModes  mode )

Set the Scroll-Mode.

Deault "left"

Parameters:
modea valid mode. See ScrollModes

Definition at line 81 of file TextLCDScroll.cpp.

bool setSpeed ( int  speed )

Set the speed, how fast to scroll the text in Characters per Second.

Parameters:
speedSpeed for scrolling in Characters per Second. Range 0.1 ... 10

Definition at line 69 of file TextLCDScroll.cpp.