asklepios
14 years ago
5 changed files with 59 additions and 9 deletions
@ -1,6 +1,6 @@ |
|||||
#ifndef COLBOUNCE_H_ |
#ifndef ROWBOUNCE_H_ |
||||
#define COLBOUNCE_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_ */ |
||||
|
@ -1,7 +1,14 @@ |
|||||
mainmenu_option next_comment |
mainmenu_option next_comment |
||||
comment "small Animations" |
comment "small Animations" |
||||
bool "rowwalk" SMALLANIMATION_ROWWALK |
bool "rowwalk" SMALLANIMATION_ROWWALK |
||||
bool "colwalk" SMALLANIMATION_COLWALK |
int "speed of rowwalk in 20ms" SMALLANIMATION_ROWWALK_SPEED "50" |
||||
bool "rowbounce" SMALLANIMATION_ROWBOUNCE |
|
||||
bool "colbounce" SMALLANIMATION_COLBOUNCE |
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 |
endmenu |
||||
|
@ -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); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
#ifndef COLBOUNCE_H_ |
||||
|
#define COLBOUNCE_H_ |
||||
|
|
||||
|
void colbounce(uint8_t times,uint8_t speed); |
||||
|
|
||||
|
#endif /* COLBOUNCE_H_ */ |
Loading…
Reference in new issue