Skip to content

Commit

Permalink
adjusted
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Nov 29, 2023
1 parent 62c6992 commit 4d542d9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion VortexEngine/src/Patterns/Multi/VortexPattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#include "../../Leds/Leds.h"
#include "../../Log/Log.h"

// add 1 to prevent the middle point from being led 0
#define MIDDLE_POINT ((LED_COUNT + 1) / 2)

VortexPattern::VortexPattern(const PatternArgs& args) :
BlinkStepPattern(args),
m_progress(0)
Expand Down Expand Up @@ -36,7 +39,9 @@ void VortexPattern::blinkOn()

void VortexPattern::poststep()
{
m_progress = (m_progress + 1) % (LED_COUNT/2);
// step till the middle point
m_progress = (m_progress + 1) % MIDDLE_POINT;
// each cycle progress to the next color
if (m_progress == 0) {
m_colorset.getNext();
}
Expand Down

0 comments on commit 4d542d9

Please sign in to comment.