Moved settings from preprocessor directives to variables. Also added a way to (for now only) display them via HTTP server.

This commit is contained in:
2019-10-02 06:13:55 +02:00
parent 382631d7d7
commit 3f6d4cb0be
16 changed files with 154 additions and 79 deletions

View File

@ -11,8 +11,8 @@ SnakeEffect::~SnakeEffect() {
}
void SnakeEffect::loop(uint16_t ms) {
if (run++ % EFFECT_SNAKE_SLOWDOWN == 0) { // Change the coordinates only on every n-th run.
if (random8(EFFECT_SNAKE_DIRECTION_CHANGE)==0 || is_turn_needed()) turn_random();
if (run++ % settings.effects.snake.slowdown == 0) { // Change the coordinates only on every n-th run.
if (random8(settings.effects.snake.direction_change)==0 || is_turn_needed()) turn_random();
this->coords = update_position(this->coords, this->direction);
}