i don't like this ethersex-menuconfig - no time left to fix rowbounce :/

This commit is contained in:
asklepios 2011-05-13 14:54:06 +00:00
parent e05bfeea1b
commit e5e41ceddd
5 changed files with 59 additions and 9 deletions

View File

@ -217,7 +217,7 @@ void display_loop(){
#ifdef SMALLANIMATION_ROWWALK
case 36:
rowwalk(10,50);
rowwalk(50,10);
break;
#endif
@ -231,6 +231,11 @@ void display_loop(){
colbounce(10,25);
break;
#endif
#ifdef SMALLANIMATION_COLBOUNCE
case 39:
rowbounce(10,25);
break;
#endif
#ifdef MENU_SUPPORT
case 42:

View File

@ -1,6 +1,6 @@
#ifndef COLBOUNCE_H_
#define COLBOUNCE_H_
#ifndef ROWBOUNCE_H_
#define ROWBOUNCE_H_
void colbounce(uint8_t times,uint8_t speed);
void rowbounce(uint8_t times,uint8_t speed);
#endif /* COLBOUNCE_H_ */
#endif /* ROWBOUNCE_H_ */

View File

@ -1,7 +1,14 @@
mainmenu_option next_comment
comment "small Animations"
bool "rowwalk" SMALLANIMATION_ROWWALK
bool "colwalk" SMALLANIMATION_COLWALK
bool "rowbounce" SMALLANIMATION_ROWBOUNCE
bool "colbounce" SMALLANIMATION_COLBOUNCE
bool "rowwalk" SMALLANIMATION_ROWWALK
int "speed of rowwalk in 20ms" SMALLANIMATION_ROWWALK_SPEED "50"
bool "colwalk" SMALLANIMATION_COLWALK
int "speed of colwalk in 20ms" SMALLANIMATION_COLWALK_SPEED "50"
bool "rowbounce" SMALLANIMATION_ROWBOUNCE
int "speed of rowbounce in 20ms" SMALLANIMATION_ROWBOUNCE_SPEED "50"
bool "colbounce" SMALLANIMATION_COLBOUNCE
int "speed of colbounce in 20ms" SMALLANIMATION_COLBOUNCE_SPEED "50"
endmenu

32
smallani/rowbounce.c Normal file
View File

@ -0,0 +1,32 @@
#include <inttypes.h>
#include "../config.h"
#include "../pixel.h"
#include "../util.h"
#include "rowbounce.h"
void rowbounce(uint8_t times,uint8_t speed)
{
uint8_t i, j,k,h;
for(k=0;k<times;k++){
clear_screen(0);
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);
}
}
wait(speed*10);
}
for (h=NUM_ROW-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);
}
}
wait(speed*10);
}
}
}

6
smallani/rowbounce.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef COLBOUNCE_H_
#define COLBOUNCE_H_
void colbounce(uint8_t times,uint8_t speed);
#endif /* COLBOUNCE_H_ */