diff --git a/src/MatrixSnake.hpp b/src/MatrixSnake.hpp index 57254ab..8a9c083 100644 --- a/src/MatrixSnake.hpp +++ b/src/MatrixSnake.hpp @@ -1091,6 +1091,7 @@ void MatrixAndSnakePatternsDemoHandler(NeoPatterns *aLedsPtr) { switch (tState) { case 0: // myLoadTest(tLedsPtr); + // Random ticker setMatrixAndSnakePatternsDemoHandlerRandomTickerText(); tLedsPtr->TickerInit(sTickerTextPtr, NeoPatterns::Wheel(0), COLOR32_BLACK, 80, sTickerDirection, FLAG_TICKER_DATA_IN_FLASH); sTickerDirection--; @@ -1103,7 +1104,7 @@ void MatrixAndSnakePatternsDemoHandler(NeoPatterns *aLedsPtr) { if (sHeartDirection == DIRECTION_UP) { tYOffset = tLedsPtr->Rows + HEART_HEIGHT; } - // move in + // move heart in tLedsPtr->MovingPicturePGM(heart8x8, COLOR32_RED_HALF, COLOR32_BLACK, tXOffset, tYOffset, tSteps, 100, sHeartDirection); break; case 2: @@ -1124,7 +1125,7 @@ void MatrixAndSnakePatternsDemoHandler(NeoPatterns *aLedsPtr) { break; case 6: - // move out - for move out, we can use Move instead of MovingPicturePGM + // move heart out - for move out, we can use Move instead of MovingPicturePGM tLedsPtr->Move(sHeartDirection, tLedsPtr->Rows, 100); // change direction for next time if (sHeartDirection == DIRECTION_DOWN) { @@ -1137,6 +1138,7 @@ void MatrixAndSnakePatternsDemoHandler(NeoPatterns *aLedsPtr) { aLedsPtr->Delay(1500); break; case 8: + // Snake or Fire or Snow pattern if (sSnakeFireSnowSelector == 0) { initSnakeAutorun(tLedsPtr, 200, COLOR32_BLUE, 1); } else if (sSnakeFireSnowSelector == 1) { diff --git a/src/NeoPatterns.h b/src/NeoPatterns.h index e83017e..686536e 100644 --- a/src/NeoPatterns.h +++ b/src/NeoPatterns.h @@ -184,8 +184,8 @@ class NeoPatterns: public virtual NeoPixel { * If aDoUpdate is true, update pattern, otherwise only redraw the pattern */ #if defined(ENABLE_PATTERN_RAINBOW_CYCLE) - void RainbowCycle(uint8_t aIntervalMillis, uint8_t aDirection = DIRECTION_UP); - void RainbowCycleD(uint8_t aDurationMillis, uint8_t aDirection = DIRECTION_UP); + void RainbowCycle(uint8_t aIntervalMillis, uint8_t aDirection = DIRECTION_UP, uint8_t aRepetitions = 1); + void RainbowCycleD(uint8_t aDurationMillis, uint8_t aDirection = DIRECTION_UP, uint8_t aRepetitions = 1); bool RainbowCycleUpdate(bool aDoUpdate = true); #endif #if defined(ENABLE_PATTERN_COLOR_WIPE) diff --git a/src/NeoPatterns.hpp b/src/NeoPatterns.hpp index dfaf083..28e5fa2 100644 --- a/src/NeoPatterns.hpp +++ b/src/NeoPatterns.hpp @@ -631,14 +631,14 @@ bool NeoPatterns::decrementTotalStepCounterAndSetNextIndex() { * Initialize for a RainbowCycle * First of 256 steps is last pixel = Wheel(0) = RED going up over yellow and green to BLUE or backwards if DIRECTION_DOWN */ -void NeoPatterns::RainbowCycleD(uint8_t aDurationMillis, uint8_t aDirection) { - RainbowCycle(aDurationMillis, aDirection | PARAMETER_IS_DURATION); +void NeoPatterns::RainbowCycleD(uint8_t aDurationMillis, uint8_t aDirection, uint8_t aRepetitions) { + RainbowCycle(aDurationMillis, aDirection | PARAMETER_IS_DURATION, aRepetitions); } -void NeoPatterns::RainbowCycle(uint8_t aIntervalMillis, uint8_t aDirection) { +void NeoPatterns::RainbowCycle(uint8_t aIntervalMillis, uint8_t aDirection, uint8_t aRepetitions) { // Must move index in opposite direction Direction = OppositeDirection(aDirection & DIRECTION_MASK); - TotalStepCounter = 256; + TotalStepCounter = 256 * aRepetitions; if (Direction == DIRECTION_UP) { Index = 0; } else { @@ -679,12 +679,13 @@ bool NeoPatterns::RainbowCycleUpdate(bool aDoUpdate) { #if defined(ENABLE_PATTERN_COLOR_WIPE) /** + * ColorWipeD 2. Parameter is complete duration and not step interval * @brief Initialize for a ColorWipe. First step is one pixel set, last step is all pixel set. * @param aMode can be 0 / FLAG_DO_CLEAR (default) or FLAG_DO_NOT_CLEAR(_BlackPixel) * @param aDirection can be DIRECTION_UP (default) or DIRECTION_DOWN */ -void NeoPatterns::ColorWipeD(color32_t aColor, uint16_t aIntervalMillis, uint8_t aMode, uint8_t aDirection) { - ColorWipe(aColor, aIntervalMillis, aMode, aDirection | PARAMETER_IS_DURATION); +void NeoPatterns::ColorWipeD(color32_t aColor, uint16_t aDurationMillis, uint8_t aMode, uint8_t aDirection) { + ColorWipe(aColor, aDurationMillis, aMode, aDirection | PARAMETER_IS_DURATION); } void NeoPatterns::ColorWipe(color32_t aColor, uint16_t aIntervalMillis, uint8_t aMode, uint8_t aDirection) { Color1 = aColor; @@ -1114,7 +1115,8 @@ bool NeoPatterns::ScannerExtendedUpdate(bool aDoUpdate) { #endif #if defined(ENABLE_PATTERN_STRIPES) -/* +/** + * StripesD Parameter is complete duration and not step interval * Start with aLength1 pixel of aLength1 followed by aLength2 pixel of aColor2 and then starting with aColor1 again until Strip ends. * If DIRECTION_DOWN the same pattern starts from the other end. * If aNumberOfSteps == (aLength1 + aLength2) the last pattern is equal first pattern diff --git a/src/utility/font_6x8.c b/src/utility/font_6x8.c index 97416c0..e8566fb 100644 --- a/src/utility/font_6x8.c +++ b/src/utility/font_6x8.c @@ -74,7 +74,7 @@ const uint8_t font_PGM[] PROGMEM = 0x0C,0x0C,0x04,0x00,0x00,0x00,0x00,0x00, // 0x60 0x00,0x00,0x0E,0x01,0x0F,0x11,0x0F,0x00, // 0x61 a 0x10,0x10,0x1E,0x11,0x11,0x11,0x1E,0x00, // 0x62 - 0x00,0x00,0x0E,0x11,0x10,0x11,0x0E,0x00, // 0x63 + 0x00,0x00,0x0E,0x10,0x10,0x10,0x0E,0x00, // 0x63 c 0x01,0x01,0x0F,0x11,0x11,0x11,0x0F,0x00, // 0x64 0x00,0x00,0x0E,0x11,0x1E,0x10,0x0E,0x00, // 0x65 0x06,0x08,0x08,0x1E,0x08,0x08,0x08,0x00, // 0x66 @@ -86,7 +86,7 @@ const uint8_t font_PGM[] PROGMEM = 0x04,0x04,0x04,0x04,0x04,0x04,0x06,0x00, // 0x6C l 0x00,0x00,0x1A,0x15,0x15,0x11,0x11,0x00, // 0x6D 0x00,0x00,0x1C,0x12,0x12,0x12,0x12,0x00, // 0x6E - 0x00,0x00,0x0E,0x11,0x11,0x11,0x0E,0x00, // 0x6F + 0x00,0x00,0x0E,0x11,0x11,0x11,0x0E,0x00, // 0x6F o 0x00,0x00,0x1E,0x11,0x11,0x11,0x1E,0x10, // 0x70 0x00,0x00,0x0F,0x11,0x11,0x11,0x0F,0x01, // 0x71 0x00,0x00,0x16,0x09,0x08,0x08,0x1C,0x00, // 0x72