-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathText.ino
55 lines (46 loc) · 977 Bytes
/
Text.ino
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
#include <PT6523.h>
PT6523 lcd;
char txt[28] = "PT6523 LIBRARY FOR ARDUINO";
char b[33];
char c[4];
int sa, sb;
char ss[9];
void setup() {
lcd.begin(10, 130); // SlaveSelect pin, chip address.
}
void loop() {
lcd.speed(300);
lcd.clear();
lcd.text("ARDUINO");
delay(1000);
lcd.text("PT6523");
delay(1000);
lcd.text("LIBRARY");
delay(1000);
lcd.clear();
for (int i = 0; lcd.textLoopCount() < 2; i++) {
sprintf(b, "THIS TEXT WILL SCROLL TWICE. - %d", 2 - lcd.textLoopCount());
lcd.sText(b);
}
lcd.clear();
lcd.speed(100);
for (int x = 20; x <= 120; x++) {
sprintf(c, "%03i", x);
lcd.text(c);
// delay(500);
}
lcd.clear();
lcd.speed(300);
for (int x = 1; x <= 10; x++) {
sa = random(10, 99);
sb = random(1, 9);
sprintf(ss, "%d+%d=%03i", sa, sb, sa + sb);
lcd.text(ss);
delay(500);
}
lcd.clear();
lcd.speed(150);
for (int i = 0; lcd.textLoopCount() < 1; i++) {
lcd.sText(txt);
}
}