Browse Source

added additional configparameters for small animations

feature/2015
asklepios 14 years ago
parent
commit
f0ec3ea285
  1. 10
      display_loop.c
  2. 1
      smallani/colwalk.c
  3. 12
      smallani/config.in
  4. 6
      smallani/rowbounce.c
  5. 1
      smallani/rowwalk.c

10
display_loop.c

@ -217,23 +217,23 @@ void display_loop(){
#ifdef SMALLANIMATION_ROWWALK #ifdef SMALLANIMATION_ROWWALK
case 36: case 36:
rowwalk(50,10); rowwalk(SMALLANIMATION_ROWWALK_COUNT,SMALLANIMATION_ROWWALK_SPEED);
break; break;
#endif #endif
#ifdef SMALLANIMATION_COLWALK #ifdef SMALLANIMATION_COLWALK
case 37: case 37:
colwalk(10,50); colwalk(SMALLANIMATION_COLWALK_COUNT,SMALLANIMATION_COLWALK_SPEED);
break; break;
#endif #endif
#ifdef SMALLANIMATION_COLBOUNCE #ifdef SMALLANIMATION_COLBOUNCE
case 38: case 38:
colbounce(10,25); colbounce(SMALLANIMATION_ROWBOUNCE_COUNT,SMALLANIMATION_COLBOUNCE_SPEED);
break; break;
#endif #endif
#ifdef SMALLANIMATION_COLBOUNCE #ifdef SMALLANIMATION_ROWBOUNCE
case 39: case 39:
rowbounce(10,25); rowbounce(SMALLANIMATION_COLBOUNCE_COUNT,SMALLANIMATION_ROWBOUNCE_SPEED);
break; break;
#endif #endif

1
smallani/colwalk.c

@ -3,7 +3,6 @@
#include "../pixel.h" #include "../pixel.h"
#include "../util.h" #include "../util.h"
//dots flying from left to right
void colwalk(uint8_t times,uint8_t speed) void colwalk(uint8_t times,uint8_t speed)
{ {
uint8_t i, j,k,h; uint8_t i, j,k,h;

12
smallani/config.in

@ -1,14 +1,18 @@
mainmenu_option next_comment mainmenu_option next_comment
comment "small Animations" comment "small Animations"
bool "rowwalk" SMALLANIMATION_ROWWALK bool "rowwalk" SMALLANIMATION_ROWWALK
int "speed of rowwalk in 20ms" SMALLANIMATION_ROWWALK_SPEED "50" int "speed of rowwalk in 10ms" SMALLANIMATION_ROWWALK_SPEED "50"
int "count of rowwalk in full cycles" SMALLANIMATION_ROWWALK_COUNT "10"
bool "colwalk" SMALLANIMATION_COLWALK bool "colwalk" SMALLANIMATION_COLWALK
int "speed of colwalk in 20ms" SMALLANIMATION_COLWALK_SPEED "50" int "speed of colwalk in 10ms" SMALLANIMATION_COLWALK_SPEED "50"
int "count of colwalk in full cycles" SMALLANIMATION_COLWALK_COUNT "10"
bool "rowbounce" SMALLANIMATION_ROWBOUNCE bool "rowbounce" SMALLANIMATION_ROWBOUNCE
int "speed of rowbounce in 20ms" SMALLANIMATION_ROWBOUNCE_SPEED "50" int "speed of rowbounce in 10ms" SMALLANIMATION_ROWBOUNCE_SPEED "50"
int "count of rowbounce in full cycles" SMALLANIMATION_ROWBOUNCE_COUNT "10"
bool "colbounce" SMALLANIMATION_COLBOUNCE bool "colbounce" SMALLANIMATION_COLBOUNCE
int "speed of colbounce in 20ms" SMALLANIMATION_COLBOUNCE_SPEED "50" int "speed of colbounce in 10ms" SMALLANIMATION_COLBOUNCE_SPEED "50"
int "count of colbounce in full cycles" SMALLANIMATION_COLBOUNCE_COUNT "10"
endmenu endmenu

6
smallani/rowbounce.c

@ -13,15 +13,15 @@ void rowbounce(uint8_t times,uint8_t speed)
for (h=0;h<NUM_ROWS;h++){ for (h=0;h<NUM_ROWS;h++){
for (i=0;i<NUM_COLS;i++){ for (i=0;i<NUM_COLS;i++){
for (j=0;j<NUM_ROWS;j++){ for (j=0;j<NUM_ROWS;j++){
setpixel( (pixel){i,j},(h==i) ? 1:0); setpixel( (pixel){i,j},(h==j) ? 1:0);
} }
} }
wait(speed*10); wait(speed*10);
} }
for (h=NUM_ROW-1;h>1;h--){ for (h=NUM_ROWS-1;h>1;h--){
for (i=0;i<NUM_COLS;i++){ for (i=0;i<NUM_COLS;i++){
for (j=0;j<NUM_ROWS;j++){ for (j=0;j<NUM_ROWS;j++){
setpixel( (pixel){i,j},((h-1)==i) ? 1:0); setpixel( (pixel){i,j},((h-1)==j) ? 1:0);
} }
} }
wait(speed*10); wait(speed*10);

1
smallani/rowwalk.c

@ -3,7 +3,6 @@
#include "../pixel.h" #include "../pixel.h"
#include "../util.h" #include "../util.h"
//dots flying from left to right
void rowwalk(uint8_t times,uint8_t speed) void rowwalk(uint8_t times,uint8_t speed)
{ {
uint8_t i, j,k,h; uint8_t i, j,k,h;

Loading…
Cancel
Save