FastLED 3.9.15
|
LIB8STATIC uint8_t submod8 | ( | uint8_t | a, |
uint8_t | b, | ||
uint8_t | m ) |
Subtract two numbers, and calculate the modulo of the difference and a third number, M.
In other words, it returns (A-B) % M. It is designed as a compact mechanism for decrementing a "mode" switch and wrapping around back to "mode 0" when the switch goes past the start of the available range. e.g. if you have seven modes, this switches to the previous one and wraps around if needed:
a | dividend byte |
b | value to subtract from the dividend |
m | divisor byte |
Definition at line 425 of file math8.h.
References LIB8STATIC.