added additional configparameters for small animations

This commit is contained in:
asklepios 2011-05-14 18:09:40 +00:00
parent e5e41ceddd
commit f0ec3ea285
5 changed files with 16 additions and 14 deletions

View File

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

View File

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

View File

@ -1,14 +1,18 @@
mainmenu_option next_comment
comment "small Animations"
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
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
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
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

View File

@ -13,15 +13,15 @@ void rowbounce(uint8_t times,uint8_t speed)
for (h=0;h<NUM_ROWS;h++){
for (i=0;i<NUM_COLS;i++){
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);
}
for (h=NUM_ROW-1;h>1;h--){
for (h=NUM_ROWS-1;h>1;h--){
for (i=0;i<NUM_COLS;i++){
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);

View File

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