-
Notifications
You must be signed in to change notification settings - Fork 0
/
tilcd.ino
98 lines (85 loc) · 2.15 KB
/
tilcd.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
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
#include "libraries/TILCD.h"
#include "libraries/fontmap.h"
TILCD *lcd;
char l;
uint8_t i = 0;
uint8_t j = 0;
// "123456789abc"
static uint8_t message1[] = " dat was ";
static uint8_t message2[] = " ......fun ";
void setup()
{
lcd = new TILCD(10, 12, A3, A0, A2, A1, 4, 5, 6, 7, 8, 9);
lcd->init(48);
for (int x = 0; x < 12; x++)
{
lcd->setX(x);
for (int y = 0; y < 64; y++)
{
lcd->writeBinaryValue(1, 0);
}
}
l = pgm_read_byte_near(FONTMAP);
}
void loop()
{
//for(uint8_t i = 0; i < 255; i++){
// Serial.println();
// for(int y = 0; y < 8; y++){
// l = pgm_read_byte_near(FONTMAP + i*8 + y);
// for(int c = 7; c >= 0; c--){
// ((l >> c) & 1) ? Serial.print('#') : Serial.print(' ');
// }
// Serial.println();
// }
// delay(1000);
i = j++;
// for (int x = 0; x < 12; x++)
// {
// lcd->setX(x);
// for (int y = 0; y < 64; y++)
// {
// lcd->writeBinaryValue(1, x);
// }
// }
// for (int c = 0; c < 12; c++)
// {
// lcd->setX(c);
// for(int r = 0; r < 8; r++){
// for(int y = 0; y < 8; y++){
// l = pgm_read_byte_near(FONTMAP + i*8 + y);
// lcd->writeBinaryValue(1, l);
// }
// i++;
// }
// }
for(int i = 0; i < 12; i++){
delay(320);
lcdputchar(message1[i], i, 3);
}
for(int i = 2; i < 12; i++){
delay(320);
lcdputchar(message2[i], i, 4);
}
//delay(500);
//lcdputchar(3, 8, 2);
delay(2000);
for (int x = 0; x < 12; x++)
{
lcd->setX(x);
for (int y = 0; y < 64; y++)
{
lcd->writeBinaryValue(1, 0);
}
}
delay(2000);
}
void lcdputchar(uint8_t c, int x, int r){
lcd->setX(x);
lcd->setY(r*8);
for(int y = 0; y < 8; y++){
l = pgm_read_byte_near(FONTMAP + c*8 + y);
lcd->writeBinaryValue(1, l);
}
return;
}