jimbobbennett / jimbobbennett/LightPi

Add fade instruction

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Add an instruction to fade from one color frame to another.

This would be a top-level JSON value called `fade`. Default value is `false`. If `true`, then after each frame is set, it will fade to the next frame.

Fading will be done at 25ms intervals (this needs to be tested to ensure it can work on a Pi Zero with a lot of lights). The fading algorithm will be:

* Determine the difference between the R, G and B values of current color and the next color.
* Divide the frame time by 25ms to work out how many intermediate frames are needed.
* Divide the difference between each color by the number of frames, and adjust the color by this difference

To hold colors between frames, set the same color for 2 frames in a row

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.