|
@@ -45,12 +45,13 @@ void simpleAnimationC(void);
|
45
|
45
|
void simpleAnimationD(void);
|
46
|
46
|
void simpleAnimationE(void);
|
47
|
47
|
void simpleAnimationF(void);
|
|
48
|
+void simpleAnimationG(void);
|
48
|
49
|
|
49
|
50
|
// Array of animation functions
|
50
|
|
-#define NUMOFANIMATIONS 6
|
|
51
|
+#define NUMOFANIMATIONS 7
|
51
|
52
|
void (*animations[NUMOFANIMATIONS])(void) = { &simpleAnimationA, &simpleAnimationB,
|
52
|
53
|
&simpleAnimationC, &simpleAnimationD, &simpleAnimationE,
|
53
|
|
- &simpleAnimationF };
|
|
54
|
+ &simpleAnimationF, &simpleAnimationG };
|
54
|
55
|
|
55
|
56
|
#define WAVELENGTH 2
|
56
|
57
|
|
|
@@ -187,3 +188,98 @@ void simpleAnimationF(void) {
|
187
|
188
|
}
|
188
|
189
|
free(buff);
|
189
|
190
|
}
|
|
191
|
+
|
|
192
|
+void simpleAnimationG(void) {
|
|
193
|
+ uint8_t *buff;
|
|
194
|
+ int8_t x, y, z;
|
|
195
|
+
|
|
196
|
+ buff = buffNew();
|
|
197
|
+
|
|
198
|
+ //Cube_1
|
|
199
|
+ buffSetPixel(buff, 3, 3, 3);
|
|
200
|
+ buffSetPixel(buff, 4, 3, 3);
|
|
201
|
+ buffSetPixel(buff, 4, 4, 3);
|
|
202
|
+ buffSetPixel(buff, 4, 4, 4);
|
|
203
|
+ setImage(buff);
|
|
204
|
+ while(isFinished() < WAVELENGTH) {
|
|
205
|
+ wdt_reset();
|
|
206
|
+ }
|
|
207
|
+ buffClearAllPixels(buff);
|
|
208
|
+
|
|
209
|
+ //Cube_2
|
|
210
|
+ for(x = 2; x < 6; x++) {
|
|
211
|
+ for(y = 2; y < 6; y++) {
|
|
212
|
+ buffSetPixel(buff, x, y, 2);
|
|
213
|
+ buffSetPixel(buff, x, y, 5);
|
|
214
|
+ }
|
|
215
|
+ }
|
|
216
|
+ for(y = 2; y < 6; y++) {
|
|
217
|
+ for(z = 2; z < 6; z++) {
|
|
218
|
+ buffSetPixel(buff, 2, y, z);
|
|
219
|
+ buffSetPixel(buff, 5, y, z);
|
|
220
|
+ }
|
|
221
|
+ }
|
|
222
|
+ for(x = 2; x < 6; x++) {
|
|
223
|
+ for(z = 2; z < 6; z++) {
|
|
224
|
+ buffSetPixel(buff, x, 2, z);
|
|
225
|
+ buffSetPixel(buff, x, 5, z);
|
|
226
|
+ }
|
|
227
|
+ }
|
|
228
|
+ setImage(buff);
|
|
229
|
+ while(isFinished() < WAVELENGTH) {
|
|
230
|
+ wdt_reset();
|
|
231
|
+ }
|
|
232
|
+ buffClearAllPixels(buff);
|
|
233
|
+
|
|
234
|
+ //Cube_3
|
|
235
|
+ for(x = 1; x < 7; x++){
|
|
236
|
+ for(y = 1; y < 7; y++) {
|
|
237
|
+ buffSetPixel(buff, x, y, 1);
|
|
238
|
+ buffSetPixel(buff, x, y, 6);
|
|
239
|
+ }
|
|
240
|
+ }
|
|
241
|
+ for(y = 1; y < 7; y++){
|
|
242
|
+ for(z = 1; z < 7; z++) {
|
|
243
|
+ buffSetPixel(buff, 1, y, z);
|
|
244
|
+ buffSetPixel(buff, 6, y, z);
|
|
245
|
+ }
|
|
246
|
+ }
|
|
247
|
+ for(x = 1; x < 7; x++){
|
|
248
|
+ for(z = 1; z < 7; z++) {
|
|
249
|
+ buffSetPixel(buff, x, 1, z);
|
|
250
|
+ buffSetPixel(buff, x, 6, z);
|
|
251
|
+ }
|
|
252
|
+ }
|
|
253
|
+ setImage(buff);
|
|
254
|
+ while(isFinished() < WAVELENGTH) {
|
|
255
|
+ wdt_reset();
|
|
256
|
+ }
|
|
257
|
+ buffClearAllPixels(buff);
|
|
258
|
+
|
|
259
|
+ //Cube_4
|
|
260
|
+ for(x = 0; x < 8; x++){
|
|
261
|
+ for(y = 0; y < 8; y++) {
|
|
262
|
+ buffSetPixel(buff, x, y, 0);
|
|
263
|
+ buffSetPixel(buff, x, y, 7);
|
|
264
|
+ }
|
|
265
|
+ }
|
|
266
|
+ for(y = 0; y < 8; y++){
|
|
267
|
+ for(z = 0; z < 8; z++) {
|
|
268
|
+ buffSetPixel(buff, 0, y, z);
|
|
269
|
+ buffSetPixel(buff, 8, y, z);
|
|
270
|
+ }
|
|
271
|
+ }
|
|
272
|
+ for(x = 0; x < 8; x++){
|
|
273
|
+ for(z = 0; z < 8; z++) {
|
|
274
|
+ buffSetPixel(buff, x, 0, z);
|
|
275
|
+ buffSetPixel(buff, x, 8, z);
|
|
276
|
+ }
|
|
277
|
+ }
|
|
278
|
+ setImage(buff);
|
|
279
|
+ while(isFinished() < WAVELENGTH) {
|
|
280
|
+ wdt_reset();
|
|
281
|
+ }
|
|
282
|
+ buffClearAllPixels(buff);
|
|
283
|
+
|
|
284
|
+ free(buff);
|
|
285
|
+}
|