-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathOledController.cpp
More file actions
123 lines (101 loc) · 2.98 KB
/
OledController.cpp
File metadata and controls
123 lines (101 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/*
Copyright 2009-13 Stephan Martin, Dominik Gummel
This file is part of Multidisplay.
Multidisplay is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Multidisplay is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Multidisplay. If not, see <http://www.gnu.org/licenses/>.
*/
#include "OledController.h"
#include "MultidisplayDefines.h"
#include <Arduino.h>
Goldelox_Serial_4DLib display(&Serial3);
OledController::OledController()
{
// display.TimeLimit4D = 1000 ;
// display.Callback4D = &(OledController::callback) ; // NULL ;
//
// //we have to start with 9600 baud
// Serial3.begin(9600);
}
void OledController::reset () {
// pinMode (OLED_RESET_PIN, OUTPUT);
// digitalWrite(OLED_RESET_PIN, LOW);
// delay(10);
// digitalWrite(OLED_RESET_PIN, HIGH);
// delay(10);
// Serial3.flush();
}
void OledController::myconstructor () {
// Serial3.print('U'); // connect
// while (Serial3.read()!=0x06) {
// delay(100);
// }
//
// display.gfx_Cls() ;
////
////// fmediatests = trymount() ;
// char wks[20];
// display.sys_GetModel(wks) ; // length is also returned, but we don't need that here
// Serial.print(F("Display model: ")) ;
// Serial.println(wks) ;
// display.putstr("Model:\n") ;
// display.putstr(wks) ;
// int i = strlen(wks) ;
// Serial.print(F("SPE2 Version: ")) ;
// Serial.println(display.sys_GetVersion()) ;
// Serial.print(F("PmmC Version: ")) ;
// Serial.println(display.sys_GetPmmC()) ;
//
// display.setDisplayBaud(BAUD_115200);
// Serial.begin(115200);
// display.GetAck();
//
// delay(1000);
// display.gfx_Cls();
//
// display.txt_MoveCursor(0,0);
// display.putstr("Hello World (1)");
//
// display.txt_MoveCursor(0,2);
// display.putstr("2");
//
//// //arduino pin connected to reset
//// display.begin(OLED_RESET_PIN);
////
//// delay(10);
//// // === Serial port speed up
//// display.setSpeed(115200);
//// Serial3.begin(115200);
////
//// display.initSD();
////
//// display.setOrientation(0x03);
//// display.setPenSolid(true);
//// display.setFontSolid(true);
//// display.setFont(0);
////
//// display.clear();
//// display.gText(0,0,"1");
//// display.gText(0,64,"Hello World");
}
OledController::~OledController() {
}
void OledController::callback(int ErrCode, unsigned char ErrByte) {
const char *Error4DText[] = {"OK\0", "Timeout\0", "NAK\0", "Length\0", "Invalid\0"} ;
Serial.print(F("Serial 4D Library reports error ")) ;
Serial.print(Error4DText[ErrCode]) ;
if (ErrCode == Err4D_NAK)
{
Serial.print(F(" returned data= ")) ;
Serial.println(ErrByte) ;
}
else
Serial.println(F("")) ;
}