w m / Mbed 2 deprecated DISTANCE_PROJECT1

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

WattBob_TextLCD Class Reference

WattBob_TextLCD Class Reference

Class to access 16*2 LCD display connected to an MCP23017 I/O extender chip. More...

#include <WattBob_TextLCD.h>

Public Member Functions

 WattBob_TextLCD (MCP23017 *port)
 Create TextLCD object connected to a MCP23017 device.
virtual void locate (int row, int column)
 Set cursor to a known point.
virtual void cls ()
 clear display
virtual void reset ()
 reset the display

Detailed Description

Class to access 16*2 LCD display connected to an MCP23017 I/O extender chip.

Derived from the "stream" class to be able to use methods such as "printf"

Example :

 .....
 #include "MCP23017.h"
 #include "WattBob_TextLCD.h"
 .....
 MCP23017            *par_port;
 WattBob_TextLCD     *lcd;
      .....
 int main()
      par_port = new MCP23017(p9, p10, 0x40);
      par_port->config(0x0F00, 0x0F00, 0x0F00);           // configure MCP23017 chip on WattBob       
      lcd = new WattBob_TextLCD(par_port);

      par_port->write_bit(1,BL_BIT);   // turn LCD backlight ON
      lcd->cls(); lcd->locate(0,0);
      lcd->printf("%s", message);
      lcd->locate(1,0);lcd->printf("press 1 to cont"); 

Definition at line 101 of file WattBob_TextLCD.h.


Constructor & Destructor Documentation

WattBob_TextLCD ( MCP23017 port )

Create TextLCD object connected to a MCP23017 device.

Parameters:
portpointer to MCP23017 object

Definition at line 46 of file WattBob_TextLCD.cpp.


Member Function Documentation

void cls (  ) [virtual]

clear display

Virtual function for stream class

Definition at line 123 of file WattBob_TextLCD.cpp.

void locate ( int  row,
int  column 
) [virtual]

Set cursor to a known point.

Virtual function for stream class

Parameters:
rowinteger row number (0 or 1)
colinteger column number (0 or 15)

Definition at line 111 of file WattBob_TextLCD.cpp.

void reset ( void   ) [virtual]

reset the display

Virtual function for stream class

Definition at line 129 of file WattBob_TextLCD.cpp.