@@ -120,6 +120,38 @@ bool demoSineWave(int frameCount, long long start, Image image) {
120
120
return ((now - start) < 8000 );
121
121
}
122
122
123
+ void rotationDemo () {
124
+
125
+ d1.clearScreen (DARK_BLUE);
126
+ int tmpWidth = 100 ;
127
+ int tmpHeight = 51 ;
128
+
129
+ Image tmpimg = Image (tmpWidth, tmpHeight, BLACK);
130
+
131
+ tmpimg.drawLine (00 , 00 , 99 , 00 , WHITE, SOLID, 1 ); // top
132
+ tmpimg.drawLine (00 , 00 , 00 , 50 , WHITE, SOLID, 1 ); // left
133
+ tmpimg.drawLine (99 , 00 , 99 , 50 , WHITE, SOLID, 1 ); // right
134
+ tmpimg.drawLine (00 , 50 , 99 , 50 , WHITE, SOLID, 1 ); // bottom
135
+
136
+ printf (" --- DEGREE_0 --------------------------------------------------\n " );
137
+ tmpimg.drawText (10 , 10 , " D_0" , &Font24, BLACK, RED);
138
+ d1.showImage (tmpimg, Point (30 , 10 ), Point (30 + tmpWidth - 1 , 10 + tmpHeight - 1 ), DEGREE_0); // RED
139
+
140
+ printf (" --- DEGREE_180 --------------------------------------------------\n " );
141
+ tmpimg.drawText (10 , 10 , " D_180" , &Font24, BLACK, GREEN);
142
+ d1.showImage (tmpimg, Point (30 , 10 ), Point (30 + tmpWidth - 1 , 10 + tmpHeight - 1 ), DEGREE_180); // GREEN
143
+
144
+ printf (" --- DEGREE_90 --------------------------------------------------\n " );
145
+ tmpimg.drawText (10 , 10 , " D_90" , &Font24, BLACK, YELLOW);
146
+ d1.showImage (tmpimg, Point (30 , 10 ), Point (30 + tmpWidth - 1 , 10 + tmpHeight - 1 ), DEGREE_90); // YELLOW
147
+
148
+ printf (" --- DEGREE_270 --------------------------------------------------\n " );
149
+ tmpimg.drawText (10 , 10 , " D_270" , &Font24, BLACK, CYAN);
150
+ d1.showImage (tmpimg, Point (30 , 10 ), Point (30 + tmpWidth - 1 , 10 + tmpHeight - 1 ), DEGREE_270); // CYAN
151
+
152
+
153
+ }
154
+
123
155
void display1Demo () {
124
156
printf (" demo1\n " ); fflush (stdout);
125
157
@@ -143,8 +175,10 @@ void display1Demo() {
143
175
d1.clearScreen (BLACK);
144
176
145
177
d1.showImage (bmp, DEGREE_270);
178
+ delay (2000 );
146
179
147
- delay (1000 );
180
+ rotationDemo ();
181
+ delay (4000 );
148
182
149
183
long long start = currentTimeMillis ();
150
184
0 commit comments