PsiSwarm Library  0.8
Display Class Reference

#include <display.h>

Inheritance diagram for Display:

Public Member Functions

 Display ()
 
 Display (PinName sda, PinName scl, PinName reset, PinName backlight)
 
void clear_display (void)
 
void home (void)
 
void write_string (char *message)
 
void write_string (char *message, char length)
 
void set_position (char row, char column)
 
void set_cursor (char enable)
 
void set_blink (char enable)
 
void set_display (char enable)
 
void set_backlight_brightness (float brightness)
 
void debug_page (char *message, char length)
 
void IF_restore_page (void)
 
void IF_debug_multipage (void)
 
void IF_backlight_toggle (void)
 
void post_init (void)
 
void post_post_init (void)
 
int i2c_message (char byte)
 
void init_display (char mode)
 
int disp_putc (int c)
 

Detailed Description

Display class Functions for use with the Midas 16x2 I2C LCD Display (MCCOG21605x6W) LCD Farnell part 2218942 or 2063206

Example:

#include "psiswarm.h"
int main() {
init();
display.clear_display; //Clears display
display.set_position(0,2); //Set cursor to row 0 column 2
display.write_string("YORK ROBOTICS");
display.set_position(1,3); //Set cursor to row 1 column 3
display.write_string("LABORATORY");
}

Definition at line 53 of file display.h.

Constructor & Destructor Documentation

§ Display() [1/2]

Display::Display ( )

Create the LCD Display object connected to the default pins (sda = p28, scl = p27, reset = p29, backlight = p30)

Definition at line 47 of file display.cpp.

§ Display() [2/2]

Display::Display ( PinName  sda,
PinName  scl,
PinName  reset,
PinName  backlight 
)

Create the LCD Display object connected to specific pins

Parameters
sdapin - default is p28
sclpin - default is p27
resetpin - default is p29
backlightpin - default is p30

Definition at line 44 of file display.cpp.

Member Function Documentation

§ clear_display()

void Display::clear_display ( void  )

Clear the display

Definition at line 230 of file display.cpp.

§ home()

void Display::home ( void  )

Set cursor to home position

Definition at line 238 of file display.cpp.

§ set_backlight_brightness()

void Display::set_backlight_brightness ( float  brightness)

Set the brightness of the backlight

Parameters
brightness- Sets the brightness of the display (range 0.0 to 1.0)

Definition at line 198 of file display.cpp.

§ set_blink()

void Display::set_blink ( char  enable)

Enable or disable cursor blink

Parameters
enable- Set to 1 to enable the cursor blinking mode

Definition at line 188 of file display.cpp.

§ set_cursor()

void Display::set_cursor ( char  enable)

Enable or disable cursor

Parameters
enable- Set to 1 to enable the cursor visibility

Definition at line 183 of file display.cpp.

§ set_display()

void Display::set_display ( char  enable)

Enable or disable display

Parameters
enable- Set to 1 to enable the display output

Definition at line 193 of file display.cpp.

§ set_position()

void Display::set_position ( char  row,
char  column 
)

Set the row and column of cursor position

Parameters
row- The row of the display to set the cursor to (either 0 or 1)
column- The column of the display to set the cursor to (range 0 to 15)

Definition at line 174 of file display.cpp.

§ write_string() [1/2]

void Display::write_string ( char *  message)

Print string message

Parameters
message- The null-terminated message to print

Definition at line 131 of file display.cpp.

§ write_string() [2/2]

void Display::write_string ( char *  message,
char  length 
)

Print string message of given length

Parameters
message- The message to print
length- The number of characters to display

Definition at line 154 of file display.cpp.


The documentation for this class was generated from the following files: