Quellcode durchsuchen

Finished hardcoding animation and deleted the ugly part of it

Max Nuding vor 12 Jahren
Ursprung
Commit
caed7272e0
2 geänderte Dateien mit 99 neuen und 53 gelöschten Zeilen
  1. 98
    2
      CubeFirmware/animations.c
  2. 1
    51
      showoff.cube

+ 98
- 2
CubeFirmware/animations.c Datei anzeigen

@@ -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
+}

+ 1
- 51
showoff.cube Datei anzeigen

@@ -1,4 +1,4 @@
1
-54
1
+49
2 2
 Showoff
3 3
 Frame 1
4 4
 00000000000000ff
@@ -490,53 +490,3 @@ ff818181818181ff
490 490
 ff818181818181ff
491 491
 ffffffffffffffff
492 492
 03
493
-Empty Frame
494
-0000000000000000
495
-0000000000000000
496
-0000000000000000
497
-0000000000000000
498
-0000000000000000
499
-0000000000000000
500
-0000000000000000
501
-0000000000000000
502
-05
503
-C
504
-0000000000000000
505
-0000000000000000
506
-003c3c0c0c3c3c00
507
-003c3c0c0c3c3c00
508
-003c3c0c0c3c3c00
509
-003c3c0c0c3c3c00
510
-0000000000000000
511
-0000000000000000
512
-0c
513
-U
514
-0000000000000000
515
-0000000000000000
516
-00666666667e7e00
517
-00666666667e7e00
518
-00666666667e7e00
519
-00666666667e7e00
520
-0000000000000000
521
-0000000000000000
522
-0c
523
-B
524
-0000000000000000
525
-0000000000000000
526
-003e120e0e123e00
527
-003e120e0e123e00
528
-003e120e0e123e00
529
-003e120e0e123e00
530
-0000000000000000
531
-0000000000000000
532
-0c
533
-E
534
-0000000000000000
535
-0000000000000000
536
-7e7e061e1e067e7e
537
-7e7e061e1e067e7e
538
-7e7e061e1e067e7e
539
-7e7e061e1e067e7e
540
-0000000000000000
541
-0000000000000000
542
-01

Laden…
Abbrechen
Speichern