Skip to content
Permalink
Browse files

Implemented asymmetric acceleration in Reverse sprite.

  • Loading branch information...
tenner committed Jul 2, 2017
1 parent 81874e3 commit 5e0eb1f81b64e6e112b90332e0868bec78fbcc85
Showing with 2 additions and 2 deletions.
  1. +2 −2 arduino/fastled_w4v2_reimpl/fastled_w4v2_reimpl.ino
@@ -433,7 +433,7 @@ class W8V1ScannerDebrisV1ReverseSprite : public Sprite {
currentPixel -= velocity;

// Are we nearer the last inflection than the next inflection? If so, speed up. Otherwise, slow down.
if (currentPixel <= (lastInflection + nextInflection) / 2) {
if (currentPixel <= nextInflection - (SCANNER_DELAY_INTERVAL_IN_MS - 1)) {
updateInterval += 1;
} else {
updateInterval -= 1;
@@ -448,7 +448,7 @@ class W8V1ScannerDebrisV1ReverseSprite : public Sprite {
if (currentPixel <= nextInflection) {
// Safety. Since I don't trust my math, once we enter scanning mode, ALWAYS go back to the constant speed for scanning
// regardless of what the math said.
updateInterval = SPRITE_STARTING_DELAY_INTERVAL_IN_MS;
updateInterval = SCANNER_DELAY_INTERVAL_IN_MS;
isScanning = true;
scanningFrame = 0;
currentPixel -= 3;

0 comments on commit 5e0eb1f

Please sign in to comment.
You can’t perform that action at this time.