FastLED 3.9.15
Loading...
Searching...
No Matches

◆ linear_map()

long fl::anonymous_namespace{frame_tracker.cpp}::linear_map ( long x,
long in_min,
long in_max,
long out_min,
long out_max )

Definition at line 7 of file frame_tracker.cpp.

7 {
8 const long run = in_max - in_min;
9 if (run == 0) {
10 return 0; // AVR returns -1, SAM returns 0
11 }
12 const long rise = out_max - out_min;
13 const long delta = x - in_min;
14 return (delta * rise) / run + out_min;
15}
int x
Definition simple.h:92

References linear_map(), and x.

Referenced by linear_map().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: