Yuji Notsu
/
Groove-Base-Shield
コネクタ4 : LED コネクタ7 : Buzzer コネクタ13 : Relay コネクタUART:Serial LCD 4つを動かしています
SerialLCD.h@0:3acc8fa91b79, 2014-01-16 (annotated)
- Committer:
- y_notsu
- Date:
- Thu Jan 16 13:27:49 2014 +0000
- Revision:
- 0:3acc8fa91b79
LPC800 MAX?Grove-Base Shield???????????????????????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
y_notsu | 0:3acc8fa91b79 | 1 | /* |
y_notsu | 0:3acc8fa91b79 | 2 | SerialLCD.h - Serial LCD driver Library |
y_notsu | 0:3acc8fa91b79 | 3 | 2010 Copyright (c) Seeed Technology Inc. All right reserved. |
y_notsu | 0:3acc8fa91b79 | 4 | |
y_notsu | 0:3acc8fa91b79 | 5 | Original Author: Jimbo.We |
y_notsu | 0:3acc8fa91b79 | 6 | Contribution: Visweswara R |
y_notsu | 0:3acc8fa91b79 | 7 | |
y_notsu | 0:3acc8fa91b79 | 8 | Modified 15 March,2012 for Arduino 1.0 IDE |
y_notsu | 0:3acc8fa91b79 | 9 | by Frankie.Chu |
y_notsu | 0:3acc8fa91b79 | 10 | |
y_notsu | 0:3acc8fa91b79 | 11 | This library is free software; you can redistribute it and/or |
y_notsu | 0:3acc8fa91b79 | 12 | modify it under the terms of the GNU Lesser General Public |
y_notsu | 0:3acc8fa91b79 | 13 | License as published by the Free Software Foundation; either |
y_notsu | 0:3acc8fa91b79 | 14 | version 2.1 of the License, or (at your option) any later version. |
y_notsu | 0:3acc8fa91b79 | 15 | |
y_notsu | 0:3acc8fa91b79 | 16 | This library is distributed in the hope that it will be useful, |
y_notsu | 0:3acc8fa91b79 | 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
y_notsu | 0:3acc8fa91b79 | 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
y_notsu | 0:3acc8fa91b79 | 19 | Lesser General Public License for more details. |
y_notsu | 0:3acc8fa91b79 | 20 | |
y_notsu | 0:3acc8fa91b79 | 21 | You should have received a copy of the GNU Lesser General Public |
y_notsu | 0:3acc8fa91b79 | 22 | License along with this library; if not, write to the Free Software |
y_notsu | 0:3acc8fa91b79 | 23 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
y_notsu | 0:3acc8fa91b79 | 24 | */ |
y_notsu | 0:3acc8fa91b79 | 25 | |
y_notsu | 0:3acc8fa91b79 | 26 | #include "mbed.h" |
y_notsu | 0:3acc8fa91b79 | 27 | |
y_notsu | 0:3acc8fa91b79 | 28 | #ifndef SERIAL_LCD_H |
y_notsu | 0:3acc8fa91b79 | 29 | #define SERIAL_LCD_H |
y_notsu | 0:3acc8fa91b79 | 30 | |
y_notsu | 0:3acc8fa91b79 | 31 | |
y_notsu | 0:3acc8fa91b79 | 32 | //Initialization Commands or Responses |
y_notsu | 0:3acc8fa91b79 | 33 | |
y_notsu | 0:3acc8fa91b79 | 34 | #define SLCD_INIT 0xA3 |
y_notsu | 0:3acc8fa91b79 | 35 | #define SLCD_INIT_ACK 0xA5 |
y_notsu | 0:3acc8fa91b79 | 36 | #define SLCD_INIT_DONE 0xAA |
y_notsu | 0:3acc8fa91b79 | 37 | |
y_notsu | 0:3acc8fa91b79 | 38 | //WorkingMode Commands or Responses |
y_notsu | 0:3acc8fa91b79 | 39 | #define SLCD_CONTROL_HEADER 0x9F |
y_notsu | 0:3acc8fa91b79 | 40 | #define SLCD_CHAR_HEADER 0xFE |
y_notsu | 0:3acc8fa91b79 | 41 | #define SLCD_CURSOR_HEADER 0xFF |
y_notsu | 0:3acc8fa91b79 | 42 | #define SLCD_CURSOR_ACK 0x5A |
y_notsu | 0:3acc8fa91b79 | 43 | |
y_notsu | 0:3acc8fa91b79 | 44 | #define SLCD_RETURN_HOME 0x61 |
y_notsu | 0:3acc8fa91b79 | 45 | #define SLCD_DISPLAY_OFF 0x63 |
y_notsu | 0:3acc8fa91b79 | 46 | #define SLCD_DISPLAY_ON 0x64 |
y_notsu | 0:3acc8fa91b79 | 47 | #define SLCD_CLEAR_DISPLAY 0x65 |
y_notsu | 0:3acc8fa91b79 | 48 | #define SLCD_CURSOR_OFF 0x66 |
y_notsu | 0:3acc8fa91b79 | 49 | #define SLCD_CURSOR_ON 0x67 |
y_notsu | 0:3acc8fa91b79 | 50 | #define SLCD_BLINK_OFF 0x68 |
y_notsu | 0:3acc8fa91b79 | 51 | #define SLCD_BLINK_ON 0x69 |
y_notsu | 0:3acc8fa91b79 | 52 | #define SLCD_SCROLL_LEFT 0x6C |
y_notsu | 0:3acc8fa91b79 | 53 | #define SLCD_SCROLL_RIGHT 0x72 |
y_notsu | 0:3acc8fa91b79 | 54 | #define SLCD_NO_AUTO_SCROLL 0x6A |
y_notsu | 0:3acc8fa91b79 | 55 | #define SLCD_AUTO_SCROLL 0x6D |
y_notsu | 0:3acc8fa91b79 | 56 | #define SLCD_LEFT_TO_RIGHT 0x70 |
y_notsu | 0:3acc8fa91b79 | 57 | #define SLCD_RIGHT_TO_LEFT 0x71 |
y_notsu | 0:3acc8fa91b79 | 58 | #define SLCD_POWER_ON 0x83 |
y_notsu | 0:3acc8fa91b79 | 59 | #define SLCD_POWER_OFF 0x82 |
y_notsu | 0:3acc8fa91b79 | 60 | #define SLCD_INVALIDCOMMAND 0x46 |
y_notsu | 0:3acc8fa91b79 | 61 | #define SLCD_BACKLIGHT_ON 0x81 |
y_notsu | 0:3acc8fa91b79 | 62 | #define SLCD_BACKLIGHT_OFF 0x80 |
y_notsu | 0:3acc8fa91b79 | 63 | |
y_notsu | 0:3acc8fa91b79 | 64 | /* |
y_notsu | 0:3acc8fa91b79 | 65 | class SerialLCD : public SoftwareSerial{ |
y_notsu | 0:3acc8fa91b79 | 66 | public: |
y_notsu | 0:3acc8fa91b79 | 67 | |
y_notsu | 0:3acc8fa91b79 | 68 | SerialLCD(uint8_t, uint8_t); |
y_notsu | 0:3acc8fa91b79 | 69 | void begin(); |
y_notsu | 0:3acc8fa91b79 | 70 | void clear(); |
y_notsu | 0:3acc8fa91b79 | 71 | void home(); |
y_notsu | 0:3acc8fa91b79 | 72 | |
y_notsu | 0:3acc8fa91b79 | 73 | void noDisplay(); |
y_notsu | 0:3acc8fa91b79 | 74 | void display(); |
y_notsu | 0:3acc8fa91b79 | 75 | void noBlink(); |
y_notsu | 0:3acc8fa91b79 | 76 | void blink(); |
y_notsu | 0:3acc8fa91b79 | 77 | void noCursor(); |
y_notsu | 0:3acc8fa91b79 | 78 | void cursor(); |
y_notsu | 0:3acc8fa91b79 | 79 | void scrollDisplayLeft(); |
y_notsu | 0:3acc8fa91b79 | 80 | void scrollDisplayRight(); |
y_notsu | 0:3acc8fa91b79 | 81 | void leftToRight(); |
y_notsu | 0:3acc8fa91b79 | 82 | void rightToLeft(); |
y_notsu | 0:3acc8fa91b79 | 83 | void autoscroll(); |
y_notsu | 0:3acc8fa91b79 | 84 | void noAutoscroll(); |
y_notsu | 0:3acc8fa91b79 | 85 | |
y_notsu | 0:3acc8fa91b79 | 86 | void setCursor(uint8_t, uint8_t); |
y_notsu | 0:3acc8fa91b79 | 87 | void noPower(void); |
y_notsu | 0:3acc8fa91b79 | 88 | void Power(void); |
y_notsu | 0:3acc8fa91b79 | 89 | void noBacklight(void); |
y_notsu | 0:3acc8fa91b79 | 90 | void backlight(void); |
y_notsu | 0:3acc8fa91b79 | 91 | void print(uint8_t b); |
y_notsu | 0:3acc8fa91b79 | 92 | void print(const char[]); |
y_notsu | 0:3acc8fa91b79 | 93 | void print(unsigned long n, uint8_t base); |
y_notsu | 0:3acc8fa91b79 | 94 | |
y_notsu | 0:3acc8fa91b79 | 95 | }; |
y_notsu | 0:3acc8fa91b79 | 96 | */ |
y_notsu | 0:3acc8fa91b79 | 97 | #endif |