source: rtos_arduino/trunk/examples/NCESIoT/LCD_Display9696/SeeedGrayOLED.h@ 226

Last change on this file since 226 was 226, checked in by ertl-honda, 8 years ago

Groveモジュールを使用したサンプルの追加

File size: 2.8 KB
Line 
1/*
2 SeeedGrayOLED.h - SSD1327 Gray OLED Driver Library
3 2011 Copyright (c) Seeed Technology Inc. All right reserved.
4
5 Author: Visweswara R
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20*/
21
22#ifndef SeeedGrayOLED_data_H
23#define SeeedGrayOLED_data_H
24
25// SeeedGrayOLED Instruction set addresses
26
27#include "Arduino.h"
28
29#define VERTICAL_MODE 01
30#define HORIZONTAL_MODE 02
31
32#define SeeedGrayOLED_Address 0x3c
33#define SeeedGrayOLED_Command_Mode 0x80
34#define SeeedGrayOLED_Data_Mode 0x40
35
36#define SeeedGrayOLED_Display_Off_Cmd 0xAE
37#define SeeedGrayOLED_Display_On_Cmd 0xAF
38
39#define SeeedGrayOLED_Normal_Display_Cmd 0xA4
40#define SeeedGrayOLED_Inverse_Display_Cmd 0xA7
41#define SeeedGrayOLED_Activate_Scroll_Cmd 0x2F
42#define SeeedGrayOLED_Dectivate_Scroll_Cmd 0x2E
43#define SeeedGrayOLED_Set_ContrastLevel_Cmd 0x81
44
45#define Scroll_Left 0x00
46#define Scroll_Right 0x01
47
48#define Scroll_2Frames 0x7
49#define Scroll_3Frames 0x4
50#define Scroll_4Frames 0x5
51#define Scroll_5Frames 0x0
52#define Scroll_25Frames 0x6
53#define Scroll_64Frames 0x1
54#define Scroll_128Frames 0x2
55#define Scroll_256Frames 0x3
56
57
58class SeeedGrayOLED {
59
60public:
61
62char addressingMode;
63
64void init(void);
65
66void setNormalDisplay();
67void setInverseDisplay();
68
69void sendCommand(unsigned char command);
70void sendData(unsigned char Data);
71void setGrayLevel(unsigned char grayLevel);
72
73void setVerticalMode();
74void setHorizontalMode();
75
76void setTextXY(unsigned char Row, unsigned char Column);
77void clearDisplay();
78void setContrastLevel(unsigned char ContrastLevel);
79void putChar(unsigned char c);
80void putString(const char *String);
81unsigned char putNumber(long n);
82unsigned char putFloat(float floatNumber,unsigned char decimal);
83unsigned char putFloat(float floatNumber);
84
85void drawBitmap(unsigned char *bitmaparray,int bytes);
86
87void setHorizontalScrollProperties(bool direction,unsigned char startRow, unsigned char endRow,unsigned char startColumn, unsigned char endColumn, unsigned char scrollSpeed);
88void activateScroll();
89void deactivateScroll();
90
91private:
92
93unsigned char grayH;
94unsigned char grayL;
95
96
97};
98
99extern SeeedGrayOLED SeeedGrayOled; // SeeedGrayOLED object
100
101#endif
102
103
Note: See TracBrowser for help on using the repository browser.