sparkfun Compatible Serial LCD

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SerialLcd.cpp Source File

SerialLcd.cpp

00001 #include "mbed.h"
00002 #include "SerialLcd.h"
00003 
00004 SerialLcd::SerialLcd(PinName TX): _lcd(TX,NC)
00005 {   
00006 //    LCD_contrast = 60; 
00007 }
00008 
00009 int SerialLcd::_putc(int value) {
00010     _lcd.putc(value);
00011     return value;
00012 }
00013 
00014 int SerialLcd::_getc() {
00015     return -1;
00016 }
00017 
00018 void SerialLcd::cls()
00019 {
00020     _lcd.putc(0xFE);
00021     _lcd.putc(0x01);
00022     wait(0.01);
00023 }
00024 
00025 void SerialLcd::locate(int clm,int row)
00026 {
00027     _lcd.putc(0xFE);
00028     _lcd.putc( 0x80 + (row * 0x40) + clm );
00029     wait(0.01);
00030 }
00031 ;