asklepios
14 years ago
7 changed files with 59 additions and 5 deletions
@ -0,0 +1,32 @@ |
|||||
|
#include <inttypes.h> |
||||
|
#include "../config.h" |
||||
|
#include "../pixel.h" |
||||
|
#include "../util.h" |
||||
|
#include "colbounce.h" |
||||
|
|
||||
|
void colbounce(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_COLS;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_COLS;h>0;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