Browse Source

real animation not just configurations ;)

feature/2015
asklepios 14 years ago
parent
commit
3bacdeb39e
  1. 14
      smallani/Makefile
  2. 23
      smallani/colwalk.c
  3. 6
      smallani/colwalk.h
  4. 5
      smallani/config.in
  5. 23
      smallani/rowwalk.c
  6. 6
      smallani/rowwalk.h

14
smallani/Makefile

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

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

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

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

23
smallani/rowwalk.c

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

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