J.W. BRUCE / TTU_CSC1300

Dependents:   CSC1300_EduBaseV2_Lab0 mbed_blinky EduBaseV2_Lab0 mbed_blinky ... more

Embed: (wiki syntax)

« Back to documentation index

TextLCD Class Reference

TextLCD Class Reference

A TextLCD interface for driving a HD44780 LCD character module connected via a 74HC595 using the F031K6 SPI peripheral. More...

#include <TTU_CSC1300.h>

Public Member Functions

 TextLCD (LCDCursor cur)
 Constructor to create a TextLCD interface.
int putc (int c)
 Write a character to the LCD at the current cursor location.
int printf (const char *format,...)
 Write a formated string to the LCD at the curren cursor location.
void setLocation (int column, int row)
 Locate cursor to a screen row and column.
void cls ()
 Clear the screen and locate to 0,0.
void setCharacter (int row, int column, int c)
 Right a single character to a specific location.
void setCursor (LCDCursor c)
 Change the LCD cursor mode.

Detailed Description

A TextLCD interface for driving a HD44780 LCD character module connected via a 74HC595 using the F031K6 SPI peripheral.

Specifically, the Nucleo32 F031K6 boards plugged into the Edubase-V2 via the adapter used at Tennessee Tech.

Supports only the 16x2 display on the EduBase-V2 board

 #include "mbed.h"
 #include "TTU_CSC1300.h"
 
 TextLCD lcd(TextLCD::LCD_CURSOR_ON_BLINKING_ON);     // select your cursor style
 
 int main() {
     lcd.printf("Hello World!\n");
 }

Definition at line 235 of file TTU_CSC1300.h.


Constructor & Destructor Documentation

TextLCD ( LCDCursor  cur )

Constructor to create a TextLCD interface.

Parameters:
curDesired behavior of LCD cursor
See also:
setCursor()
TextLCD::LCD_CURSOR_OFF_BLINKING_OFF No cursor and no blinking block
TextLCD::LCD_CURSOR_OFF_BLINKING_ON No cursor and but blinking block
TextLCD::LCD_CURSOR_ON_BLINKING_OFF Underline cursor and no blinking block
TextLCD::LCD_CURSOR_ON_BLINKING_ON Both underlinecursor and blinking block

Definition at line 176 of file TTU_CSC1300.cpp.


Member Function Documentation

void cls (  )

Clear the screen and locate to 0,0.

Definition at line 212 of file TTU_CSC1300.cpp.

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

Write a formated string to the LCD at the curren cursor location.

Parameters:
formatA printf-style format string, followed by the variables to use in formating the string.
Note:
A string is denoted whthin double-quotes.
int putc ( int  c )

Write a character to the LCD at the current cursor location.

Parameters:
cThe character to write to the display
See also:
setLocation()
void setCharacter ( int  row,
int  column,
int  c 
)

Right a single character to a specific location.

Parameters:
rowThe vertical position from the top, indexed from 0
columnThe horizontal position from the left, indexed from 0
cThe character to display on-screen
Note:
A character is denoted within single-quotes (apostrophes)

Definition at line 207 of file TTU_CSC1300.cpp.

void setCursor ( LCDCursor  c )

Change the LCD cursor mode.

Parameters:
cA LCDCursor type denoted the cursor and blink
See also:
TextLCD::LCD_CURSOR_OFF_BLINKING_OFF
TextLCD::LCD_CURSOR_OFF_BLINKING_ON
TextLCD::LCD_CURSOR_ON_BLINKING_OFF
TextLCD::LCD_CURSOR_ON_BLINKING_ON

Definition at line 202 of file TTU_CSC1300.cpp.

void setLocation ( int  column,
int  row 
)

Locate cursor to a screen row and column.

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

Definition at line 218 of file TTU_CSC1300.cpp.