asklepios
14 years ago
6 changed files with 77 additions and 0 deletions
@ -0,0 +1,14 @@ |
|||
TARGET = libsmallanimations.a |
|||
TOPDIR = .. |
|||
|
|||
include $(TOPDIR)/defaults.mk |
|||
|
|||
ifeq ($(SMALLANIMATION_ROWWALK),y) |
|||
SRC += rowwalk.c |
|||
endif |
|||
ifeq ($(SMALLANIMATION_COLWALK),y) |
|||
SRC += colwalk.c |
|||
endif |
|||
|
|||
|
|||
include $(TOPDIR)/rules.mk |
@ -0,0 +1,23 @@ |
|||
#include <inttypes.h> |
|||
#include "../config.h" |
|||
#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; |
|||
|
|||
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); |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,6 @@ |
|||
#ifndef COLWALK_H_ |
|||
#define COLWALK_H_ |
|||
|
|||
void colwalk(uint8_t times,uint8_t speed); |
|||
|
|||
#endif /* COLWALK_H_ */ |
@ -0,0 +1,5 @@ |
|||
mainmenu_option next_comment |
|||
comment "small Animations" |
|||
bool "rowwalk" SMALLANIMATION_ROWWALK |
|||
bool "colwalk" SMALLANIMATION_COLWALK |
|||
endmenu |
@ -0,0 +1,23 @@ |
|||
#include <inttypes.h> |
|||
#include "../config.h" |
|||
#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; |
|||
|
|||
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==j) ? 1:0); |
|||
} |
|||
} |
|||
wait(speed*10); |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,6 @@ |
|||
#ifndef ROWWALK_H_ |
|||
#define ROWWALK_H_ |
|||
|
|||
void rowwalk(uint8_t times,uint8_t speed); |
|||
|
|||
#endif /* ROWWALK_H_ */ |
Loading…
Reference in new issue