Skip to content

Commit

Permalink
found the bug in this fade code
Browse files Browse the repository at this point in the history
  • Loading branch information
rambo committed Mar 23, 2013
1 parent cbea6c7 commit d7c83c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion software/arduino/partyhatwork/animation_tasks.h
Expand Up @@ -190,7 +190,7 @@ void AnimationRunner::interpolate_fade()
}
if (tmpval1 > tmpval2)
{
fade_frame.leds[i][ii] = tmpval2 - (((tmpval1 - tmpval2) / num_fade_steps) * fade_step);
fade_frame.leds[i][ii] = tmpval1 - (((tmpval1 - tmpval2) / num_fade_steps) * fade_step);
}
else
{
Expand Down
4 changes: 1 addition & 3 deletions software/pc/animationbuilder/animationbuilder.html
Expand Up @@ -272,9 +272,7 @@ <h2>Generated code</h2>
}
if (tmpval1 > tmpval2)
{
// This is buggy somehow, on xmega using unisgned types hides the error
//tmp = tmpval2 - Math.floor(((tmpval1 - tmpval2) / fade_num_steps) * fade_current_step);
tmp = Math.abs(tmpval2 - Math.floor(((tmpval1 - tmpval2) / fade_num_steps) * fade_current_step));
tmp = tmpval1 - Math.floor(((tmpval1 - tmpval2) / fade_num_steps) * fade_current_step);
}
else
{
Expand Down

0 comments on commit d7c83c1

Please sign in to comment.