NOT FINISHED YET!!! My first try to get a self built fully working Quadrocopter based on an mbed, a self built frame and some other more or less cheap parts.
LCD.h
00001 /* mbed LCD Library, for a 4-bit LCD based on HD44780 00002 * Copyright (c) 2007-2010, hb9gaa 00003 */ 00004 00005 #ifndef LCD_H 00006 #define LCD_H 00007 00008 #include "mbed.h" 00009 00010 class TextLCD : public Stream { 00011 public: 00012 00013 /** LCD panel format */ 00014 enum LCDType { 00015 LCD16x2 /**< 16x2 LCD panel (default) */ 00016 , LCD16x2B /**< 16x2 LCD panel alternate addressing */ 00017 , LCD20x2 /**< 20x2 LCD panel */ 00018 , LCD20x4 /**< 20x4 LCD panel */ 00019 }; 00020 00021 /** Create a TextLCD interface 00022 * @param rs Instruction/data control line 00023 * @param e Enable line (clock) 00024 * @param d0-d3 Data lines 00025 * @param type Sets the panel size/addressing mode (default = LCD16x2) 00026 */ 00027 TextLCD(PinName rs, PinName rw, PinName e, PinName d0, PinName d1, PinName d2, PinName d3, LCDType type = LCD16x2); 00028 00029 #if DOXYGEN_ONLY 00030 /** Write a character to the LCD 00031 * @param c The character to write to the display 00032 */ 00033 int putc(int c); 00034 00035 /** Write a formated string to the LCD 00036 * @param format A printf-style format string, followed by the 00037 * variables to use in formating the string. 00038 */ 00039 int printf(const char* format, ...); 00040 #endif 00041 00042 /** Locate to a screen column and row 00043 * @param column The horizontal position from the left, indexed from 0 00044 * @param row The vertical position from the top, indexed from 0 00045 */ 00046 void locate(int column, int row); 00047 00048 /** Clear the screen and locate to 0,0 */ 00049 void cls(); 00050 00051 int rows(); 00052 int columns(); 00053 00054 protected: 00055 00056 // Stream implementation functions 00057 virtual int _putc(int value); 00058 virtual int _getc(); 00059 00060 int address(int column, int row); 00061 void character(int column, int row, int c); 00062 void writeByte(int value); 00063 void writeCommand(int command); 00064 void writeData(int data); 00065 00066 DigitalOut _rs, _rw, _e; 00067 BusOut _d; 00068 LCDType _type; 00069 00070 int _column; 00071 int _row; 00072 }; 00073 00074 #endif
Generated on Tue Jul 12 2022 20:54:01 by 1.7.2