Skip to content

Commit

Permalink
Railway FX
Browse files Browse the repository at this point in the history
- slower minimum speed
- allow color 1 & 2 in UI
  • Loading branch information
blazoncek committed Dec 26, 2022
1 parent 6f67132 commit 6d1ff7c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wled00/FX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2351,7 +2351,7 @@ static const char _data_FX_MODE_METEOR_SMOOTH[] PROGMEM = "Meteor Smooth@!,Trail
//Railway Crossing / Christmas Fairy lights
uint16_t mode_railway()
{
uint16_t dur = 40 + (255 - SEGMENT.speed) * 10;
uint16_t dur = (256 - SEGMENT.speed) * 40;
uint16_t rampdur = (dur * SEGMENT.intensity) >> 8;
if (SEGENV.step > dur)
{
Expand All @@ -2368,16 +2368,16 @@ uint16_t mode_railway()
if (SEGENV.aux0) pos = 255 - pos;
for (int i = 0; i < SEGLEN; i += 2)
{
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(255 - pos, false, false, 255));
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(255 - pos, false, false, 255)); // do not use color 1 or 2, always use palette
if (i < SEGLEN -1)
{
SEGMENT.setPixelColor(i + 1, SEGMENT.color_from_palette(pos, false, false, 255));
SEGMENT.setPixelColor(i + 1, SEGMENT.color_from_palette(pos, false, false, 255)); // do not use color 1 or 2, always use palette
}
}
SEGENV.step += FRAMETIME;
return FRAMETIME;
}
static const char _data_FX_MODE_RAILWAY[] PROGMEM = "Railway@!,Smoothness;;!";
static const char _data_FX_MODE_RAILWAY[] PROGMEM = "Railway@!,Smoothness;1,2;!";


//Water ripple
Expand Down

0 comments on commit 6d1ff7c

Please sign in to comment.