sparkfun Compatible Serial LCD
Embed:
(wiki syntax)
Show/hide line numbers
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 ;
Generated on Sun Jul 17 2022 01:45:36 by 1.7.2