source: rtos_arduino/trunk/examples/NCESIoT_RTOS/OLED_Display12864/SeeedOLED.h@ 242

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

RTOSのサンプルを追加

File size: 2.7 KB
Line 
1/*
2 SeeedOLED.h - SSD130x 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 SeeedOLED_data_H
23#define SeeedOLED_data_H
24
25// SeeedOLED Instruction set addresses
26
27#if defined(ARDUINO) && ARDUINO >= 100
28#include "Arduino.h"
29#else
30#include <WProgram.h>
31#include "Wire.h"
32#endif
33
34
35
36#define SeeedOLED_Max_X 127 //128 Pixels
37#define SeeedOLED_Max_Y 63 //64 Pixels
38
39#define PAGE_MODE 01
40#define HORIZONTAL_MODE 02
41
42
43#define SeeedOLED_Address 0x3c
44#define SeeedOLED_Command_Mode 0x80
45#define SeeedOLED_Data_Mode 0x40
46#define SeeedOLED_Display_Off_Cmd 0xAE
47#define SeeedOLED_Display_On_Cmd 0xAF
48#define SeeedOLED_Normal_Display_Cmd 0xA6
49#define SeeedOLED_Inverse_Display_Cmd 0xA7
50#define SeeedOLED_Activate_Scroll_Cmd 0x2F
51#define SeeedOLED_Dectivate_Scroll_Cmd 0x2E
52#define SeeedOLED_Set_Brightness_Cmd 0x81
53
54#define Scroll_Left 0x00
55#define Scroll_Right 0x01
56
57#define Scroll_2Frames 0x7
58#define Scroll_3Frames 0x4
59#define Scroll_4Frames 0x5
60#define Scroll_5Frames 0x0
61#define Scroll_25Frames 0x6
62#define Scroll_64Frames 0x1
63#define Scroll_128Frames 0x2
64#define Scroll_256Frames 0x3
65
66
67class SeeedOLED {
68
69public:
70
71char addressingMode;
72
73
74void init(void);
75
76void setNormalDisplay();
77void setInverseDisplay();
78
79void sendCommand(unsigned char command);
80void sendData(unsigned char Data);
81
82void setPageMode();
83void setHorizontalMode();
84
85void setTextXY(unsigned char Row, unsigned char Column);
86void clearDisplay();
87void setBrightness(unsigned char Brightness);
88void putChar(unsigned char c);
89void putString(const char *String);
90unsigned char putNumber(long n);
91unsigned char putFloat(float floatNumber,unsigned char decimal);
92unsigned char putFloat(float floatNumber);
93void drawBitmap(unsigned char *bitmaparray,int bytes);
94
95void setHorizontalScrollProperties(bool direction,unsigned char startPage, unsigned char endPage, unsigned char scrollSpeed);
96void activateScroll();
97void deactivateScroll();
98
99};
100
101extern SeeedOLED SeeedOled; // SeeedOLED object
102
103#endif
104
105
Note: See TracBrowser for help on using the repository browser.