Merge pull request #4181 from DedeHai/0_15_trig_math

Added integer based `sin()/cos()` functions, changed all trig functions to wled_math
This commit is contained in:
Damian Schneider
2024-11-27 22:27:56 +01:00
committed by Frank
parent 5ea9cb1907
commit e914417c74
5 changed files with 319 additions and 179 deletions

View File

@@ -102,9 +102,9 @@ private:
void secondsEffectSineFade(int16_t secondLed, Toki::Time const& time) {
uint32_t ms = time.ms % 1000;
uint8_t b0 = (cos8(ms * 64 / 1000) - 128) * 2;
uint8_t b0 = (cos8_t(ms * 64 / 1000) - 128) * 2;
setPixelColor(secondLed, gamma32(scale32(secondColor, b0)));
uint8_t b1 = (sin8(ms * 64 / 1000) - 128) * 2;
uint8_t b1 = (sin8_t(ms * 64 / 1000) - 128) * 2;
setPixelColor(inc(secondLed, 1, secondsSegment), gamma32(scale32(secondColor, b1)));
}