Added effect "snake".
This commit is contained in:
@ -53,6 +53,9 @@
|
||||
|
||||
#define EFFECT_CONFETTI_PIXELS_PER_LOOP 2
|
||||
|
||||
#define EFFECT_SNAKE_DIRECTION_CHANGE 10
|
||||
#define EFFECT_SNAKE_SLOWDOWN 2
|
||||
|
||||
#ifdef DEBUG
|
||||
#define LOG(x) Serial.print(x);
|
||||
#define LOGln(x) Serial.println(x);
|
||||
|
21
include/effect_snake.h
Normal file
21
include/effect_snake.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef effect_snake_H
|
||||
#define effect_snake_H
|
||||
|
||||
#include "Effect.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
class SnakeEffect : public Effect {
|
||||
private:
|
||||
Coords coords;
|
||||
uint8_t direction;
|
||||
uint8_t hue;
|
||||
uint8_t run;
|
||||
Window window = {0, 0, LED_WIDTH, LED_HEIGHT-6};
|
||||
public:
|
||||
void loop();
|
||||
boolean valid_position(Coords c);
|
||||
Coords update_position(Coords c, uint8_t direction);
|
||||
boolean can_be_shown_with_clock();
|
||||
};
|
||||
|
||||
#endif
|
@ -34,6 +34,11 @@ typedef struct Matrix {
|
||||
double a22;
|
||||
} Matrix;
|
||||
|
||||
typedef struct {
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
} Coords;
|
||||
|
||||
extern uint8_t baseHue;
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user