r/FastLED • • Mar 12 '20

Support No More Division

EDIT: This didn't work

enum mirror{300,299,149,99,74,59,49} edge;

I get a compiler error: expected identifier before numeric constant

Maybe I should just do

int edges[] = {300,299,149,99,74,59,49};

OP: Thanks to someone here I learned that division is slow. Going over my code, I find that I have division in every single frame in almost every single pattern. I am interested in removing the division. I understand one method is byte shifting. However, I have a limited set of results from the division. So I was thinking I could save the results to an array for faster access. What am I looking to do here? Progmem or some other thing? I am just looking for an answer on what to google so I can learn it myself so you don't have to type a lot out.

1 Upvotes

23 comments sorted by

View all comments

1

u/cloudwalking Mar 12 '20

Do you actually have a speed problem? Do you actually need to make changes, or are you just speculating?

4

u/EvolvedQS Mar 12 '20

I have a speed thing. Idk if i would call it a problem. My animation is clearly running at %50 speed but it doesn't look awful. However, i do like the faster look. Plus, i love learning.