-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOutput.ino
More file actions
41 lines (39 loc) · 1014 Bytes
/
Output.ino
File metadata and controls
41 lines (39 loc) · 1014 Bytes
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
//Display output in terminal/OLED/Whatever
void SetText(String line1) {
if (line1.length() > 20) {
SetText(line1.substring(0, 10), line1.substring(11, 20), line1.substring(21));
return;
}
if (line1.length() > 10) {
SetText(line1.substring(0, 10), line1.substring(11), "");
return;
}
SetText(line1, "", "");
}
void SetText(String line1, String line2) {
if (line2.length() > 10)
SetText(line1, line2.substring(0, 10), line2.substring(11));
else
SetText(line1, line2, "");
}
void SetText(String line1, String line2, String line3) {
//display.clear();
//display.setColor(WHITE);
//display.setTextAlignment(TEXT_ALIGN_LEFT);
//display.drawString(0, 0, line1);
//display.drawString(0, 20, line2);
//display.drawString(0, 40, line3);
//display.display();
#if DEBUG
Serial.print(line1);
if (line2 != "") {
Serial.print(": ");
Serial.print(line2);
}
if (line3 != "") {
Serial.print(" ");
Serial.print(line3);
}
Serial.println();
#endif
}