real animation not just configurations ;)

This commit is contained in:
asklepios 2011-05-12 20:17:10 +00:00
parent 284fbac533
commit 3bacdeb39e
6 changed files with 77 additions and 0 deletions

14
smallani/Makefile Normal file
View File

@ -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

23
smallani/colwalk.c Normal file
View File

@ -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);
}
}
}

6
smallani/colwalk.h Normal file
View File

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

5
smallani/config.in Normal file
View File

@ -0,0 +1,5 @@
mainmenu_option next_comment
comment "small Animations"
bool "rowwalk" SMALLANIMATION_ROWWALK
bool "colwalk" SMALLANIMATION_COLWALK
endmenu

23
smallani/rowwalk.c Normal file
View File

@ -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);
}
}
}

6
smallani/rowwalk.h Normal file
View File

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