Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:f30bad3f815d, committed 2013-07-11
- Comitter:
- komaida424
- Date:
- Thu Jul 11 19:17:02 2013 +0000
- Commit message:
- name change from SelialLCD to SerialLcd
Changed in this revision
| SerialLcd.cpp | Show annotated file Show diff for this revision Revisions of this file |
| SerialLcd.h | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SerialLcd.cpp Thu Jul 11 19:17:02 2013 +0000
@@ -0,0 +1,31 @@
+#include "mbed.h"
+#include "SerialLcd.h"
+
+SerialLcd::SerialLcd(PinName TX): _lcd(TX,NC)
+{
+// LCD_contrast = 60;
+}
+
+int SerialLcd::_putc(int value) {
+ _lcd.putc(value);
+ return value;
+}
+
+int SerialLcd::_getc() {
+ return -1;
+}
+
+void SerialLcd::cls()
+{
+ _lcd.putc(0xFE);
+ _lcd.putc(0x01);
+ wait(0.01);
+}
+
+void SerialLcd::locate(int clm,int row)
+{
+ _lcd.putc(0xFE);
+ _lcd.putc( 0x80 + (row * 0x40) + clm );
+ wait(0.01);
+}
+;
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SerialLcd.h Thu Jul 11 19:17:02 2013 +0000
@@ -0,0 +1,23 @@
+#ifndef MBED_SERIALLCD_H
+#define MBED_SERIALLCD_H
+
+#include "mbed.h"
+#include "stdarg.h"
+
+class SerialLcd : public Stream
+{
+public:
+ SerialLcd(PinName);
+
+ void cls();
+ void locate(int,int);
+private:
+ virtual int _putc(int value);
+ virtual int _getc();
+ Serial _lcd;
+ int LCD_addr;
+ char LCD_cmd;
+ char LCD_data;
+ int LCD_contrast;
+};
+#endif
\ No newline at end of file