FX: Usermod Temperature effect

This commit is contained in:
Blaz Kristan
2024-09-15 11:04:02 +02:00
parent 0806c7fbdb
commit 65a8dbfe41
5 changed files with 28 additions and 12 deletions

View File

@@ -6483,11 +6483,6 @@ static const char _data_FX_MODE_2DWAVERLY[] PROGMEM = "Waverly@Amplification,Sen
#endif // WLED_DISABLE_2D
// float version of map()
static float mapf(float x, float in_min, float in_max, float out_min, float out_max){
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
// Gravity struct requited for GRAV* effects
typedef struct Gravity {
int topLED;

View File

@@ -378,6 +378,7 @@ uint16_t crc16(const unsigned char* data_p, size_t length);
um_data_t* simulateSound(uint8_t simulationId);
void enumerateLedmaps();
uint8_t get_random_wheel_index(uint8_t pos);
float mapf(float x, float in_min, float in_max, float out_min, float out_max);
// RAII guard class for the JSON Buffer lock
// Modeled after std::lock_guard

View File

@@ -612,3 +612,8 @@ uint8_t get_random_wheel_index(uint8_t pos) {
}
return r;
}
// float version of map()
float mapf(float x, float in_min, float in_max, float out_min, float out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}