-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule1.ino
124 lines (95 loc) · 1.58 KB
/
module1.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#include "TFT_eSPI.h"
#include "image.h"
TFT_eSPI tft= TFT_eSPI();
TFT_eSprite sprite=TFT_eSprite(&tft);
#image dimensions
int imageW=590;
int imageH=291;
int screenW=240;
int screenH=135;
int screenArea=screenW*screenH;
int start=1;
int endFlag=1;
int m=imageW;
unsigned short imageS[screenArea]={0};
void setup()
{
tft.init();
tft.setRotation(1);
tft.setSwapBytes(true);
tft.fillScreen(TFT_WHITE);
}
//Start Position
int x=0;
int y=4;
//Current Position
int pos=0;
//Steps
int changeX=1;
int changeY=1;
void loop()
{
if (endFlag ==1)
{
tft.fillScreen(TFT_WHITE);
tft.setCursor(12, 12, 2);
tft.setTextColor(TFT_BLACK,TFT_WHITE);
tft.setTextSize(2);
delay(1000);
tft.print("Po");
delay(250);
tft.print(" Nee");
delay(250);
tft.println(" Po...");
delay(1000);
tft.print(" The");
delay(250);
tft.print(" Pain");
delay(250);
tft.print(" of");
delay(250);
tft.println(" Love!");
delay(1000);
tft.print("By");
delay(250);
tft.print(" Anirudh");
delay(250);
tft.println(".R");
delay(1000);
tft.fillScreen(TFT_WHITE);
}
scrollNotes();
}
void scrollNotes()
{
endFlag=0;
pos=x+imageW*y;
start=pos;
m=screenW+pos;
for(int i=0;i<screenW*screenH;i++)
{
if(start%m==0)
{
start=start+(imageW-screenW);
m=m+imageW;
}
imageS[i]=pnp_chorus_sheet[start];
start++;
}
x=x+changeX;
if((x==imageW-screenW-1 || x<0) && y == 4)
{
x=0;
y=27;
delay(500);
}
else if((x==imageW-screenW-1 || x<0) && y == 27)
{
x=0;
y=4;
delay(500);
endFlag=1;
}
tft.pushImage(0,0,screenW,screenH,imageS);
delay(25);
}