Skip to content

Commit

Permalink
Theater chase for orbit fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LivingSynthesis committed Nov 17, 2023
1 parent b089475 commit e78959e
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions VortexEngine/src/Patterns/Multi/TheaterChasePattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "../../Leds/Leds.h"

#define THEATER_CHASE_STEPS 10
#define THEATER_CHASE_STEPS LED_COUNT

TheaterChasePattern::TheaterChasePattern(const PatternArgs &args) :
BlinkStepPattern(args),
Expand All @@ -21,7 +21,7 @@ void TheaterChasePattern::init()
{
BlinkStepPattern::init();
// starts on odd evens
m_ledPositions = MAP_PAIR_ODD_EVENS;
m_ledPositions = MAP_PAIR_EVENS;
m_stepCounter = 0;
}

Expand All @@ -32,13 +32,8 @@ void TheaterChasePattern::blinkOn()

void TheaterChasePattern::poststep()
{
// the first 5 steps are odd evens/odds alternating each step
if (m_stepCounter < 5) {
m_ledPositions = (m_stepCounter % 2) ? MAP_PAIR_ODD_ODDS : MAP_PAIR_ODD_EVENS;
} else {
// the end 5 steps are even evens/odds alternating each step
m_ledPositions = (m_stepCounter % 2) ? MAP_PAIR_EVEN_ODDS : MAP_PAIR_EVEN_EVENS;
}
// the steps are odd evens/odds alternating each step
m_ledPositions = (m_stepCounter % 2) ? MAP_PAIR_ODDS : MAP_PAIR_EVENS;
// increment step counter
m_stepCounter = (m_stepCounter + 1) % THEATER_CHASE_STEPS;
}

0 comments on commit e78959e

Please sign in to comment.